Page 1 of 1

Simple HTML Form Problem.

Posted: Sat Sep 07, 2002 4:59 am
by spKenny
This is Test.html
---------------------------------------------
<HTML>
<HEAD></HEAD>
<BODY>
<FORM METHOD=GET ACTION="text.php">
Who is your favourite author?
<INPUT NAME="Author" TYPE="TEXT">
<BR>
<BR>
<INPUT TYPE=SUBMIT>
</FORM>
</BODY>
</HTML>
--------------------------------------------
And this is text.php
--------------------------------------------
<HTML>
<HEAD></HEAD>
<BODY>
Your favorite author is:
<?php
echo $Author;
?>
</BODY>
</HTML>

--------------------------------------------
When i run this code, i get Undefined variable Author in text.php. Do anyone knows why?

thanks
-Kenny.

Posted: Sat Sep 07, 2002 6:58 am
by Dale
It works fine for me...

Erm im not sure why it wont work for you....

Example:
http://www.imahosting.com/dale/php/spKenny/

Posted: Sat Sep 07, 2002 8:10 am
by Sergiy
You should read 'sticky' posts before posting this :-)

And your code should look like this

Code: Select all

<HTML>
<HEAD></HEAD>
<BODY>
Your favorite author is:
<?php 
echo $HTTP_GET_VARS&#1111;'Author'];
?>
</BODY>
</HTML>
or like that

Code: Select all

<HTML>
<HEAD></HEAD>
<BODY>
Your favorite author is:
<?php 
echo $_GET&#1111;'Author'];
?>
</BODY>
</HTML>
depending on a PHP version you use...

Posted: Sat Sep 07, 2002 11:39 am
by Takuma
If you have PHP4.1+ then use $_GET
If you have PHP4.0- then use $HTTP_GET_VARS :P

Posted: Sat Sep 07, 2002 12:15 pm
by twigletmac
The sticky post in question that you really should have read before posting is:
http://www.devnetwork.net/forums/viewtopic.php?t=511

Mac

Posted: Sat Sep 07, 2002 2:56 pm
by spKenny
Thanx guys.