Forum Moderators: coopster
Im having trouble with getting information from a form. I was following some little tutorial just to get my handle on things and I did everything exactly like the tutorial except it doesnt work.
Here is my simple little html form:
<form action="test.php" method=post>
<fieldset><legend>Form</legend>
<label for="name">Name:</label><input type="text" size="15" id="name" name="name"><br><br>
<label for="text">Text:</label><input type="text" size="15" id="text" name="text"><br><br>
<input type="submit" name="submit" value="Click Me">
</fieldset>
</form>
Now I know my form works because I switched it to 'get' and I can see the values in the query string and retrieve them with a little javascript function, but when it comes to php I cant get the values.
Here is the php nearly identical to the tutorial...
Hi <?php print $name;?><br><br>
You entered: <?php print $text;?>
According to the tutorial all you have to do to get data from a form field is call the variable of the form field, $name. Am I wrong in this or missing a step in between?
Can someone point out my stupid mistake or tell me what I may have done wrong? :)
Thanks