Beginning PHPBeginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Right, I've got one of the PHP for Pro books from Wrox and im just beginning out and I've been trying to follow the tutorials but for some reason, this error keeps coming up even though i've followed the tutorials exactly. :/
Scenario: Userform.html has a form which ya put yer name in, it posts it to a processform.php but the processform.php always comes up with this error:
"Notice: Undefined variable: name in d:\Inetpub\wwwroot\testing\processform.php on line 4"
I understand that it doesnt seem to be getting the variable that I just inputted from the page before.
#### Userform.html
<html>
<FORM ACTION="processform.php" METHOD=POST>
Please type your name here: <br>
<INPUT TYPE=TEXT NAME=username> <br><br>
<INPUT TYPE=SUBMIT VALUE="Submit Data">
</FORM>
</html>
Now I've encountered 1 more problem, I cant seem to keep the information from more than one page ago. Basicly its an error that says "Notice: Undefined index" :/
---------------------
You cant be something, until you aspire ;)
When it doesn't get a value you get an error
this is what you need to do
<?
if(isset($_POST["username"])){
$username=$_POST["username"];
}
else{
echo("no value posted");
}
?>
__________________________________________________ ________
This is my junk I'm gona eat it