#33655 [Com]: PHP seams to not processing the POST data

From: Date: Tue, 12 Jul 2005 14:51:47 +0000
Subject: #33655 [Com]: PHP seams to not processing the POST data
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-81754@lists.php.net to get a copy of this message
ID: 33655 Comment by: mgazza2 at hotmail dot com Reported By: gzsolt at yahoo dot com Status: Feedback Bug Type: CGI related Operating System: Windows XP SP1 PHP Version: 4.3.11 New Comment: if (strpos($_SERVER["REQUEST_METHOD"],"POST")<>-1){ if (strpos($_SERVER["CONTENT_TYPE"],'application/x-www-form-urlencoded')<>-1){ $ValueArray=split('[&]', $HTTP_RAW_POST_DATA); foreach ($ValueArray as $V){ $V=split('=', $V); $_POST[$V[0]]=urldecode($V[1]); } } } opps slight mistake lolz Previous Comments: ------------------------------------------------------------------------ [2005-07-12 16:33:58] mgazza2 at hotmail dot com heres a simple script to include() at the begging of all files to your server to get php $_POST to be defined you can now thank me, :D how ever this only works with url encoded data <?php if ($SERVER["REQUEST_METHOD"]="POST") if (strtolower($SERVER["CONTENT_TYPE"])='application/x-www-form-urlencoded'){ $ValueArray=split('[&]', $HTTP_RAW_POST_DATA); foreach ($ValueArray as $V){ $V=split('=', $V); $_POST[$V[0]]=urldecode($V[1]); } } ?> ------------------------------------------------------------------------ [2005-07-12 16:02:18] mgazza2 at hotmail dot com still what if i needed to create a game which alowed people to interface "bot" behaviour and i wanted to use php to achive this, this bug is that php is not compliant with cgi/1.1 apache will use mod_cgi and fast cgi. the orginal post also buy the looks uses there own server also im guessing it will be totally different to mine except the way in which it calls php. its oka i can easily fix this problem its just that the server will no longer truely be compliant with cgi/1.1 regards mark ------------------------------------------------------------------------ [2005-07-12 15:46:58] tony2001@php.net Actually the question was to the original reporter. I doubt that we support some "handmade" servers, so try regular Apache first. ------------------------------------------------------------------------ [2005-07-12 15:32:37] mgazza2 at hotmail dot com we use our own self made win32 web servers running on windows xp. i have tried with php 4.4.0, 4.3.10, 4.3.8, 4.3.11. try testing this http://solar-software.ath.cx/posttest.html sample php script <?php echo '<b>HTTP_RAW_POST_DATA</b> '.$HTTP_RAW_POST_DATA; echo '<br /><b>HTTP_POST_VARS</b> '.$HTTP_POST_VARS; echo '<br /><b>_POST</b> '.$_POST; echo '<br /><b>_SERVER["CONTENT_LENGTH"]</b> '.$_SERVER["CONTENT_LENGTH"]; echo '<br /><b>_SERVER["CONTENT_TYPE"]</b> '.$_SERVER["CONTENT_TYPE"]; echo '<br /><b>_SERVER["GATEWAY_INTERFACE"]</b> '.$_SERVER["GATEWAY_INTERFACE"]; ?> sample perl script print "Content-type: text/html\n\n"; read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); print "<b>Perl STDIN contains</b> ".$buffer; exit(0); regards mark, ------------------------------------------------------------------------ [2005-07-12 15:12:58] tony2001@php.net Not enough information was provided for us to be able to handle this bug. Please re-read the instructions at http://bugs.php.net/how-to-report.php If you can provide more information, feel free to add it to this bug and change the status back to "Open". Thank you for your interest in PHP. What webserver do you use? Did you try with PHP 4.4.0? Can you provide a short reproduce script? Can you try to run the same code with non-Windows OS? ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/33655 -- Edit this bug report at http://bugs.php.net/?id=33655&edit=1

« previous php.bugs (#81754) next »