Simple HTML Form Problem.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
spKenny
Forum Newbie
Posts: 2
Joined: Sat Sep 07, 2002 4:59 am

Simple HTML Form Problem.

Post 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.
Dale
Forum Contributor
Posts: 466
Joined: Fri Jun 21, 2002 5:57 pm
Location: Atherstone, Warks

Post 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/
Sergiy
Forum Newbie
Posts: 6
Joined: Mon Jun 03, 2002 3:00 am
Location: Kharkiv, UA
Contact:

Post 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...
User avatar
Takuma
Forum Regular
Posts: 931
Joined: Sun Aug 04, 2002 10:24 am
Location: UK
Contact:

Post by Takuma »

If you have PHP4.1+ then use $_GET
If you have PHP4.0- then use $HTTP_GET_VARS :P
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post 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
spKenny
Forum Newbie
Posts: 2
Joined: Sat Sep 07, 2002 4:59 am

Post by spKenny »

Thanx guys.
Post Reply