variables wont' carry over to the next page
| From: | Grant | Date: | Thu, 08 May 2003 17:08:38 +0000 |
| Subject: | variables wont' carry over to the next page | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-146883@lists.php.net to get a copy of this message | ||
I have been following the book to learn PHP and it is not working.
The first page has the fields that user would enter. The second pages would
basically reprint what the user said. The second page (handleform.php) will
not print what ever is in the variable but say this "Notice: Undefined
variable: FirstName in C:\Inetpub\wwwroot\handleform.php on line 7". Any
idea what I am doing wrong?
I included the codes that I am using.
**********************************
form.php**************************************
<HTML>
<HEAD>
<TITLE>Select State</TITLE>
</HEAD>
<BODY>
<FORM ACTION="handleform.php" METHOD=POST>
First Name <INPUT TYPE=TEXT NAME="FirstName" Size=20><BR>
Last Name <INPUT TYPE = TEXT Name = "LastName" Size=40><BR><BR>
E-Mail <INPUT TYPE = TEXT Name = "Email" Size=60><BR><BR>
Comments <TEXTAREA NAME = "Comments" ROWS=5
COLS=40></TEXTAREA><BR><BR>
<INPUT TYPE=SUBMIT Name="SUBMIT" Value = "Submit!">
</FORM>
</BODY>
</HTML>
**********************************
form.php**************************************
**********************************
handleform.php**************************************
<html>
<head>
<title>Title here!</title>
</head>
<body>
<?PHP
print "Your First Name is $FirstName .<BR>\n";
print "Your Last Name is $LastName.<BR>\n";
print "Your E-maill Address $Email.<BR>\n";
print "This is what you said $Comments.<BR>\n";
?>
</body>
</html>
**********************************
handleform.php**************************************