php

PHP : How to understand bitmask value of access from ini_get_all function

i'm start to use ini_get_all function to retrieve all configuration option on a shared host server. in the end i got this chunk of array : [allow_call_time_pass_reference] => Array ( [global_value] => 1 [local_value] => 1 [access] => 6 ) [allow_url_fopen] => Array ( [global_value] => 1 ...

PHP: POST Request to ASP.NET website results in 500 server error when html tags included

My situation: I need to send text to an ASP.NET web service using POST. The entire page there is a form: <form name="aspnetForm" method="post" action="Discussion.aspx?classroom=lG39il1cotOAGJwiNvmQlIPfwmjikD%2fAHLhjjGInAZQ%3d&amp;Page=Posts&amp;ID=794239&amp;Sort=&amp;SortOrder=" id="aspnetForm"> So, I figured if I sent a POST request...

How to log slow queries in shared hosting MySQL?

I have a shared hosting where I have my website and MySQL database. I've installed a open source script for statistics (phpMyVisites) and it started to work very slow lately. It's written using some kind of framework and has many PHP files. I know that to find slow queries I can use slow query log functionality in MySQL. But on this shar...

Continuous build integration tool for Rails and PHP?

Most of "multi-platform" CI tools I've seen are in the Java/.NET world, like TeamCity or Hudson. Is there a continuous integration tool that can handle both PHP and Rails projects? ...

Get first word in string php the_title WordPress

Hi, I'm trying to shorten a wordpress title to just the first word. For a page named "John Doe" I want to have a sub title somewhere on the page that says "About John" so I want to just get the first word from the title. Is there a way to do this with PHP? Thanks! ...

Why does this sql statement keep saying it is a boolean and not a parameter? (php/Mysql)

In this statement, I am trying to see if there if the latest posting in the database that has the exact same title, price, city, state, detail. If there is, then it would say to the user that the exact post has been already made; if not then insert the posting into the dbc. (This is one type of check so that users can't accidentally post...

Convert Video To MP3 in php?

Hey, I'm just wondering if it would be possible to convert videos to mp3 files in php, if so, could someone point me in the right direction? ...

zend studio 7 creating .sharedentries and .listing

i created project in zend studio and there are files called .sharedentries and .listing gets created on all folders and sub folders of the project, its annoying, cause i would have to delete all these files and then upload. does anyone know what can i do to turn this off, so it dont create it anymore? ...

How do I select the most recent entry in mysql?

i want to select the most recent entry from a table and see if that entry is exactly the same as the one the user is trying to enter. How do I do a query to "select * from the most recent entry of 'posting'"? $query="Select * FROM //confused here (SELECT * FROM posting ORDER BY date_added DESC) WHERE user_id='{$_SESSION[...

Do sockets opened with fsockopen stay open after you leave the page via your browser?

if(isset($_GET['host'])&&is_numeric($_GET['time'])){ $pakits = 0; ignore_user_abort(TRUE); set_time_limit(0); $exec_time = $_GET['time']; $time = time(); //print "Started: ".time('h:i:s')."<br>"; $max_time = $time+$exec_time; $host = $_GET['host']; for($i=0;$i<65000;$i++){ $out .= 'X'; ...

Check if a variable is empty

I have some user-submitted variables that I want to display in a different part of my site like this: <div class="pre_box">Term: </div> <div class="entry"><?php $key='term'; echo get_post_meta($post->ID, $key, true); ?></div> Occasionally, these variables might be empty in which case I don't want to display the label for the empty var...

how to log incorrect entries (php .htaccess)

Hey there, I have created an .htaccess files that will prevent anyone from accessing a file unless he has a username and a password, how can I log files when anyone tries to access with incorrect information and then ban the Ip address. I know it in php but .htaccess i am still new to it. Thank you everyone. ...

Write a foreach loop for array of SimpleXMLElements

Hi, I am using the XPath in PHP 5 to parse a XML document. The problem I have is writing a foreach to correctly display the following array: XML document sample value 1 value 2 $xmlfile = 'link_to_file.xml'; $xmlRaw = file_get_contents($xmlfile); ...

How can I multiply each item in an array easily with PHP?

I have an array called $times. It is a list of small numbers (15,14,11,9,3,2). These will be user submitted and are supposed to be minutes. As PHP time works on seconds, I would like to multiply each element of my array by 60. I've been playing around with array_walk and array_map but I can't get those working :S Thanks. ...

Doctrine YAML not generating correctly? Or is this markup wrong?

I'm trying to get a many-to-many relationship between Users and Settings. The models seem to be generated correctly, however the following query fails: "User_Setting" with an alias of "us" in your query does not reference the parent component it is related to. $q = new Doctrine_RawSql(); $q->select('{s.*}, {us.*}') ->from('U...

Can Doctrine INDEXBY be used in the RawSql function? If so, where to place?

Is it possible to have the Doctrine Collection INDEXBY feature used in RawSql? If so, how? I'd like to index the collection returned by the following query on s.constant_name. $q = new Doctrine_RawSql(); $q->select('{s.*}, {us.*}') ->from('User u CROSS JOIN Setting s LEFT JOIN User_Setting us ON us....

Less-than operator failing in a PHP string

var_dump('<a>') // or var_dump("<a>") // or var_dump("\x3Ca>") // all result in string(3) "" What is going on? Only putting a space after the less-than sign works for me. PHP Version 5.2.10-2ubuntu6.4 ...

Doctrine: Unable to execute either CROSS JOIN or SELECT FROM Table1, Table2?

Using Doctrine I'm trying to execute either a 1. CROSS JOIN statement or 2. a SELECT FROM Table1, Table2 statement. Both seem to fail. The CROSS JOIN does execute, however the results are just wrong comparing to execution in Navicat. The multiple table SELECT doesn't even execute because Doctrine automatically tries to LEFT JOIN the ...

Pastebin-like app without sql

Hi, there is any pastebin-like php open source system without sql? I want to install it on localhost and dont want to backup sql. edit: Highlighting as much as possible languages (as pastebin.com). ...

doctrine reference?

i've found one cheat sheet for doctrine: cheat sheet but it doesn't list all methods for Doctrine_Record, Doctrine_Core, Doctrine_Query etc. i wonder if there is a such reference? Would be very helpful. ...