p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Beginning PHP (http://p2p.wrox.com/forumdisplay.php?f=95)
-   -   POST method behave strangely (http://p2p.wrox.com/showthread.php?t=12587)

laxenai May 4th, 2004 07:41 AM

POST method behave strangely
 
Hello,

I am using a Linux Red Hat OS + PHP 4.3.0 + Apache

I got a problem with HTML form and PHP POST method wich work strangely.

<form action="b.php" method="post">
     <input name="entry1" type="text">
     <input value="GO" type="submit">
</form>

In the 'b.php' script i do :
<?
echo "\$_POST['entry1'] = {$_POST['entry1']} <br>";
?>

the result is (i typed '42' as the value to display) :
$_POST['entry1'] = 42Entry1=42; //it glues both variable name+value

It does works well with GET method, but not with POST. The phpinfo() method shows that the _POST variable =>'42Entrey1=42'<= and that the QUERY_STRING variable is empty (wich is not true with the GET method wich works properly)...

What's wrong ?
Thank you

Snib May 4th, 2004 12:23 PM

I have never heard of this happening. Try this (although I believe your code should work; maybe it's a bug of PHP 4.3.0):

echo "\$_POST['entry1'] = " . $_POST['entry1'] . "<BR>";

HTH,

Snib

<><


All times are GMT -4. The time now is 05:54 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.