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

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">

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>";




All times are GMT -4. The time now is 03:19 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.