Unrecognized variables obtained with forms+post
| From: | Adam Trist | Date: | Wed, 23 Aug 2000 15:01:26 +0000 |
| Subject: | Unrecognized variables obtained with forms+post | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-13171@lists.php.net to get a copy of this message | ||
I have a small (well, not so small) with variables passed to php scripts
with 'posted' forms. Example:
# cat test.html
<HTML>
<HEAD>
<TITLE>test</TITLE>
</HEAD>
<BODY>
<FORM method="POST" action="test.php">
<P>Test
<INPUT type="text" name="test" size=10 maxlength=20></P>
<INPUT type="submit" value="Submit">
</FORM>
</BODY>
</HTML>
# cat test.php
<HTML>
<HEAD>
<TITLE>test</TITLE>
</HEAD>
<BODY>
<?php
$test2 = "test2";
echo "<p> Test 1 = $test </p>";
echo "<p> Test 2 = $test2 </p>";
?>
<?phpinfo()?>
</BODY></HTML>
If i submit a value of 'foo' in the test.html's form, i get:
Test 1 =
Test 2 = test2
-snip-
HTTP_POST_VARS["test"] foo
Apparently, the echo $test returns nothing, but the phpinfo shows the
variable and it's value.. any idea about what could be wrong?
Regards,
Adam Trist