If I run which java from the command line I get the proper input (/usr/java/…/bin/java). However if I run it in a php script: <? echo 'java. ' . shell_exec('which java'); echo 'ls. ' . …
Sending POST data without form
Can i send for example a string or another piece of information to another .php file without it being exposed [thus not by GET but by POST conform to what i know] without using a form? Answer If you don’t want your data to be seen by the user, use a PHP session. Data in a post request is still
Reconnection of Client when server reboots in WebSocket
I am using web socket using PHP5 and the Chrome browser as client. I have taken the code from the site http://code.google.com/p/phpwebsocket/. I run the server, and the client is also connected. I …
PHP calculate age
I’m looking for a way to calculate the age of a person, given their DOB in the format dd/mm/yyyy. I was using the following function which worked fine for several months until some kind of glitch caused the while loop to never end and grind the entire site to a halt. Since there are almost 100,000 DOBs …
Passing Value Including Spaces on Ajax Call
Trying to pass spaces along with ajax call. ‘word’ is been passed the same as ‘word ‘ i believe so. On the other hand two words need to be send completely with call. ‘word second’ but not the same as ‘word second ‘ Should I trim before call or do this on server …
PHP – make session expire after X minutes
i am using the following technique… From the login.php the form posts to the page check.php where i do this and on loggedin.php page the first thing i do is but once logged in when i directly type the url localhostmyProjectloggedin.php it displays the page…which makes perfect sense because the ses…
php mkdir() chmod and permissions
i was using this basic script: i create this directory and then upload photos to it. I’ve been doing this for a good 4-5 months now and suddenly i start getting ‘FORBIDDEN’ errors when I attempt to view the contents of the folder via web browser The directory is being created the same and th…
How do I set a MysQL variable (time_zone) from within doctrine / symfony?
I would like to know how I can set the MySQL time zone to UTC (SET time_zone = ‘UTC’) from within Symfony/Doctrine, so when I call a UNIX_TIMESTAMP() function on a DATETIME field in my query, it returns the UTC unix time and not unix time in the server’s time zone. How can I do this, either …
PHP – Debugging Curl
I’d like to see what the post fields in the request are before I send it. (For debugging purposes). The PHP library (class) I am using is already made (not by me), so I am trying to understand it. As far as I can tell, it uses curl_setopt() to set different options like headers and such and then it uses
How do I debug a webhook POST?
A webhook is sending me a POST, and I want to do some debugging on it. Currently I’m looping over the array and then sending a mail() to myself instead of printing (because how could I see what’s …