#33655 [Bgs]: PHP seams to not processing the POST data
| From: | gzsolt at yahoo dot com | Date: | Wed, 13 Jul 2005 07:24:14 +0000 |
| Subject: | #33655 [Bgs]: PHP seams to not processing the POST data | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-81788@lists.php.net to get a copy of this message | ||
ID: 33655
User updated by: gzsolt at yahoo dot com
Reported By: gzsolt at yahoo dot com
Status: Bogus
Bug Type: CGI related
Operating System: Windows XP SP1
PHP Version: 4.3.11
New Comment:
Ehhh... This one was a false positiv too. Neither of mgazza2's tip
helped, but still one of his post contained a lead to my problem. I was
accidentally set the content-type to text/html and this caused php to
not to process the post data.
Sorry for the false bug report, i hope it did not caused much trouble!
Previous Comments:
------------------------------------------------------------------------
[2005-07-12 18:07:36] sniper@php.net
Fix your webserver..
------------------------------------------------------------------------
[2005-07-12 17:14:22] mgazza2 at hotmail dot com
i fixed it without using the code!!
i left spaces in the envar Content_legnth and content_type
eg $_SERVER["CONTENT_LENGTH"]=' 8' perl is ok with this but php doesnt
want the space check your server code to see if it was doin the same as
mine
sorry php guys looks like it was my bad :(
------------------------------------------------------------------------
[2005-07-12 17:00:21] gzsolt at yahoo dot com
tonny2001: a few hours ago i tried the 4.4 and 5.? php (i dont remember
right now, and at home i dont have internet access :( ), in both case
the problem persist. If you want i can post the code, but is merely
more then a form width two fields (user / pass), and a print_r($_POST);
.
mgazza2: Thanks for your tip (adding the \r\n), i will try out as soon
as i get home. The code you sent lately would not be an option, because
i want to use php witch i did not wrote and dont want them edit
(phpmyadmin for example), but thanks, if the other tip does not help, i
will use it perhaps in my own scripts.
Ps.: Sorry for my bad english!
------------------------------------------------------------------------
[2005-07-12 16:51:47] mgazza2 at hotmail dot com
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
------------------------------------------------------------------------
[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]);
}
}
?>
------------------------------------------------------------------------
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