ID:               33655
 User updated by:  gzsolt at yahoo dot com
 Reported By:      gzsolt at yahoo dot com
-Status:           Feedback
+Status:           Open
 Bug Type:         CGI related
 Operating System: Windows XP SP1
 PHP Version:      4.3.11
 New Comment:

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!


Previous Comments:
------------------------------------------------------------------------

[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]);
    }
        }
?>

------------------------------------------------------------------------

[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] [EMAIL PROTECTED]

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,

------------------------------------------------------------------------

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

Reply via email to