Content-length and other HTTP headers?

I think its only because of the HTTP Spec says to do this in every case possible. Applications SHOULD use this field to indicate the transfer-length of the message-body, unless this is prohibited by the rules in section 4.4. You can also look at Pauls Answer on the Question of Deaomon. I think this will … Read more

Switch between multiple database in PDO

I know that I am a couple of months late but you should be able to switch between databases from within your query. examples: $sql = “SELECT * FROM dbname.tablename”; $sql = “SELECT * FROM anotherdbname.anothertablename” So even if your original $pdo object was used ‘blahblah’ as the dbname, you should still be okay based … Read more

How do I check if array contains at least one empty value?

Another solution: $array = array(‘one’, ‘two’, ”); if(count(array_filter($array)) == count($array)) { echo ‘OK’; } else { echo ‘ERROR’; } http://codepad.org/zF9KkqKl Also, $containsEmpty = in_array(“”, $arr); Should be a bit faster as it doesn’t have to trace the entire array and doesn’t have to create a new array. Note that both solutions will consider 0, false, … Read more

How to give apache permission to write to home directory?

As your file residing in your Home directory, I would suggest one of following approaches. Give 0777 permission to file itself. chmod 0777 /home/djameson/test.txt Change Ownership to apache user www-data and give owner-write permission. sudo chown www-data:www-data /home/djameson/test.txt chmod 0744 /home/djameson/test.txt Add your user to www-data group or vice-verse add www-data user to your group. … Read more