<html>
<head>
<title>Week #5 BASIC ~ Lestat</title>
<link rel="stylesheet" type="text/css" href="/css/scriptskewl.css">
</head>

<body>
<? /* Write a script to submit a username and password
to enter a page. If the username and password does not
match the variable hardcoded in the script show the login
form again with an error message. The password field
should be private so that as you type you'll see ****. This
should all be one self-contained script with NO include() or
require() files. */
?>


<?

// Hard code password
$password "pass";
$username "user";

// Code to run when submit is clicked
if($_POST['action'] == "true"){
if(
$password == $_POST['entry'] & $username == $_POST['name_entry']){
    print(
"Thank you for entering the correct password</body></html>"); // If password matches the entry
    
exit;}
else{
    print(
"<strong><font color='red'>Sorry, Either Your Username or Password is Incorrect<br>Please try again</font></strong>"); // If password doesnt match entry
        
}
}
?>
  

<form method="POST" action="wk5basic.php">
<input type="hidden" name="action" value="true">
Please Enter Your Username:
<input type="text"  name="name_entry"><br>
Please Enter Your Password: 
<input type="password"  name="entry"><br>
<input type="submit" value="Try Your Luck">
</form>




<pre>
</pre>
<br>
<iframe src='wk5basicsrc.php' width='850' height='300'></iframe>
<br>

<a href='../index.html'>BACK</a>

</body>
</html>