HTML beginner |
|
ik heb een probleempje met dit simpel scriptje:
<?php
$Wanted_Username = "hier loginnaam";
$Wanted_Password = "hier wachtwoord";
if($username)
{
if(!$password)
{
die("Enter a password<br><a href=\"javascript:history.go(-1)\">Back</a>");
}
if($username != $Wanted_Username)
{
die("Incorrect Details<br><a href=\"javascript:history.go(-1)\">Back</a>");
}
if($password != $Wanted_Password)
{
die("Incorrect Details<br><a href=\"javascript:history.go(-1)\">Back</a>");
}
}
if(!$username)
{
?>
<form method="post">
<table>
<tr><td colspan=2><b><font color=red>enter in your username and password</font></b></td></tr>
<tr><td>username</td><td><input type=text name=username maxlength=150></td></tr>
<tr><td>password</td><td><input type=password name=password></td></tr>
<tr><td colspan=2><input type=submit value="login"></td></tr>
</table>
</form>
<?php
die("");
}
?>
<?php $Wanted_Username = "hier loginnaam"; $Wanted_Password = "hier wachtwoord"; if($username) { if(!$password) { die("Enter a password<br><a href=\"javascript:history.go(-1)\">Back</a>"); } if($username != $Wanted_Username) { die("Incorrect Details<br><a href=\"javascript:history.go(-1)\">Back</a>"); } if($password != $Wanted_Password) { die("Incorrect Details<br><a href=\"javascript:history.go(-1)\">Back</a>"); } } if(!$username) { ?> <form method="post"> <table> <tr><td colspan=2><b><font color=red>enter in your username and password</font></b></td></tr> <tr><td>username</td><td><input type=text name=username maxlength=150></td></tr> <tr><td>password</td><td><input type=password name=password></td></tr> <tr><td colspan=2><input type=submit value="login"></td></tr> </table> </form> <?php } ?>
Ik krijg deze error:
Notice: Undefined variable: username in c:\program files\easyphp1-7\www\index.php on line 5
Notice: Undefined variable: username in c:\program files\easyphp1-7\www\index.php on line 20
het loginform staat er wel onder.
Waar zit deze fout, ik kan ze nergens vinden.
|