Re: Unrecognized variables obtained with forms+post

From: Date: Wed, 23 Aug 2000 16:13:40 +0000
Subject: Re: Unrecognized variables obtained with forms+post
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-13175@lists.php.net to get a copy of this message
Hi, One thing that I do not understand --> How do you transmit your data $test You need to write the value of your data in the file test.html like this <INPUT type="text" name="test" size=10 maxlength=20 value="what you want"> Ludovic Adam Trist a écrit : > 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

« previous php.general (#13175) next »