Blormalmcoomare
New Member
this is the code i am working on (it is part of this tutorial http://www.homeandlearn.co.uk/php/php4p9.html )this works fine` A BASIC HTML FORM\[code\]<?PHPif (isset($_POST['Submit1'])) {$username=$_POST['username'];if($username=="ken"){ print("you the man"); } else { print("you are not supposed to be here"); } } else{ $username=""; }?></head><body><FORM NAME ="form1" METHOD ="post" ACTION = "basicForm.php">username: <INPUT TYPE = "TEXT" VALUE ="http://stackoverflow.com/questions/10562186/<?PHP print $username;?>"NAME="username"><INPUT TYPE = "Submit" Name = "Submit1" VALUE = "http://stackoverflow.com/questions/10562186/Login"></FORM></body></html>`\[/code\]But this does not\[code\]<html><head><title>A BASIC HTML FORM</title><?PHPif (isset($_POST['Submit1'])) {$username=$_POST['username'];$nickname=$_POST['nickname'];if($username=='ken'and$nickname=='hawk'){ print("you the man"); } else { print("you are not supposed to be here"); } } else{ $username=""and$nickname=""; }?></head><body><FORM NAME ="form1" METHOD ="post" ACTION = "testformken.php">nickname: <input type="text" VALUE ="http://stackoverflow.com/questions/10562186/<?PHP print $nickname;?>" name="nickname" /><br />username: <input type="text" VALUE ="http://stackoverflow.com/questions/10562186/<?PHP print $username;?>" name="username" /><INPUT TYPE = "Submit" Name = "Submit1" VALUE = "http://stackoverflow.com/questions/10562186/Login"></FORM></body></html>\[/code\]I get this Notice: Undefined variable: nickname in C:\wamp\www\testformken.php on line 30 Call Stack #TimeMemoryFunctionLocation 10.1800367256{main}( )..\testformken.php:0 " name="nickname" />I have messed with a few things and if i change \[code\]nickname: <input type="text" VALUE ="http://stackoverflow.com/questions/10562186/<?PHP print $nickname;?>" name="nickname" /><br /> tonickname: <input type="text" VALUE ="http://stackoverflow.com/questions/10562186/<?PHPprint$nickname;?>" name="nickname" /><br />\[/code\]I do not get a the undifined variable but it does not print the nickname eitherif i change the value to \[code\]<?PHP print $username;?> \[/code\]enter code here i do not get the undifined variable.