Help, i have some code which will not work but should!!!

Status
Not open for further replies.
A

Anonymous

Guest
this is the handleform
<?

/* this page receives and handles the data generated by chapter3.htm */
print ("Your first name is $FirstName.<br>\n");
print ("Your last name is $LastName.<br>\n");
print ("Your E-mail address is $Email.<br>\n");
print ("This is what you had to say:<br>\n $Comments<br>\n");
?>

this is the html

<body>
<center>
<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>
E-Mail Address <input type="text" name="Email" size=60><br>
Comments <TEXTAREA name="Comments" rows=5 cols=40></textarea><br>
<input type=submit name"Submit" value="submit">
<input type=reset name="reset" value="Reset">
</form>
</center>
</body>
</html>

im getting errors on the data handled but when i add:
$FirstName = $_POST['FirstName']; etc it works i thought PHP did this automaticly

Thanks for your help
:lol: :lol:
 
You have to use $_POST['FirstName'] instead of $FirstName because PHP now sets the global variable to off (more secure). You can set them on again if you wish (and have root access to your server) but I wouldn't recommend it.

Seeing there's actually a thread on this very subject here I will close this one.
 
Status
Not open for further replies.
Back
Top