Prosoxi.com php functions!
PHP $_POST Array Empty
Fellow PHP programmers, I encountered a most peculiar problem today that I must share. I had a situation where someone was sending me POST data but the PHP $_POST array was empty. I setup a debugging script to see the GET and POST arrays and sure enough everything was empty. I asked my friend Google and found a neat way to get the raw incoming message using PHP:
$data = file_get_contents('php://input');
That convinced me that they were in fact sending me what looked like POST data but for some reason the PHP $_POST array was still empty. Long story short, what I discovered and hopefully what will save someone out there some time, is that if the Content-Type is empty or not recognized in the HTTP message then the PHP $_POST array is empty. Not sure if this is a bug or is by design…
Anyway if the guy on the other end can’t figure out how to send a properly formatted HTTP message, you can force the Content-Type as a last resort using something like this above where you want to access the $_POST array:
if(empty($_SERVER['CONTENT_TYPE'])){ $type = "application/x-www-form-urlencoded"; $_SERVER['CONTENT_TYPE'] = $type; }
<?php
if ($_SERVER['REQUEST_METHOD'] == 'POST')
{
echo '<pre>',print_r($_POST, TRUE),'</pre><br /><br /><br />';
}
?>
<form method="post" action="">
<input type="hidden" name="test1" value="one" />
<input type="hidden" name="test2" value="two" />
<input type="hidden" name="test3" value="three" />
<input type="submit" value="Test Me" />
</form>
Source
http://www.bradino.com/php/empty-post-array/
http://stackoverflow.com/questions/1282909/php-post-array-empty-upon-form-submission
Synaptics Gesture Suite™ Device Driver
The Synaptics Gesture Suite device driver is now equipped with Scrybe gesture workflow technology – the next generation in TouchPad™-based PC interfaces. Scrybe gesture workflows can greatly enhance your productivity by expanding your Synaptics TouchPad capabilities. By combining Synaptics Gesture Suite’s scrolling, zooming, and rotation gestures with Scrybe’s symbols, one can unleash the power of the TouchPad! Continue reading “Synaptics Gesture Suite™ Device Driver”
Cross-domain cookies/sessions in Safari and all other browsers
The Problem
Safari does not allow cross-domain cookies. In other words, if on X.com, you load an iFrame with contents of Y.com and set a cookie in the iFrame, Safari will not save the cookie. This problem also occurs in IE6/7 but can be resolved by sending a P3P header.
Continue reading “Cross-domain cookies/sessions in Safari and all other browsers”
10 jQuery Tagging and Tag Clouds
A jQuery tag-cloud is a great way of showing visitors to your blog the main topics of interest that are available. Today we listed Most Desirable Collection Of powerful jQuery and Ajax tag cloud . We obviously cannot cover all the best from the web, but we have tried to cover as much as possible. Have fun!
jquery upload plugins
Uploading files without refreshing page looks nice and even simple. With the help of ajax and jquery one can achieve this. Today I have collected 7 ajax file upload plugins which are cool and easy to integrate.