Right im new to php, and i have been doing tutorials on a website to learn php, well now im upto form handling and this is what i do
I create a document called form.html and write this code:
<form action="FormHandler.php" method="POST">
<input type="text" name="FirstElement">
<input type="text" name="SecondElement">
<input type="submit" value="Send form">
</form>
Then i create a php file called FormHandler.php and write this code:
<?php
echo($FirstElement);
echo($SecondElement);
?>
So then i run the Form.html file, then submit it. Then i get this error :
Notice: Undefined variable: FirstElement in d:\inetpub\monster.2ya\learn\FormHandler.php on line 2
Notice: Undefined variable: SecondElement in d:\inetpub\monster.2ya\learn\FormHandler.php on line 3
What am i doing wrong. Thanx
Form Handling
Moderator: General Moderators
Try:
And look up on $_POST and $_GET variable in the forums around here.
Code: Select all
<?php
echo($_POSTї'FirstElement']);
echo($_POSTї'SecondElement']);
?>