Re: Unrecognized variables obtained with forms+post
| From: | Dave Jones | Date: | Wed, 23 Aug 2000 19:09:03 +0000 |
| Subject: | Re: Unrecognized variables obtained with forms+post | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-13200@lists.php.net to get a copy of this message | ||
Try opening test.php with URL encoded parameters to see if it works.
http://<whatever>/test.php?test=this+is+a+test
I had a friend who's page worked with the GET method but not the POST
method.
Adam Trist wrote:
>
> 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
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
--
--------------------
To send e-mail to me replace the
domain name with djdesign.com
The phony "anti.spam" domain
is used to fool newsgroup e-mail
address harvestor 'bots.
----------------------