This is my 1st time posting on this site, and coming to an end in my PHP class. Looking through Stack and as well as some script validators I am not seeing any errors, however when I am going to my login view page it is giving me an Undefined Variable in line 3
<?php if( $bad_login ) : ?>
Login.php = just source coding
<?php
$bad_login = false;
if ( isset($_POST['username'], $_POST['password'])){
if( $_POST['username'] == 'admin' && $_POST['password'] == 'password' ){
} else {
$bad_login = true;
}
}
require( "showbooks.php" );
?>
login.view.php simple login form (Should pop login error msg or success(which is where my problem is))
<h1>Please Login In</h1>
<?php if( $bad_login ) : ?>
<p>Username and Password combination is Invalid.</p>
<?php endif ?>
<form action="login.view.php<?php ?>" method="post" accept-charset="utf-8">
<p>
<label for="username">Username: </label><input type ="text" name="username" value="" id="username">
</p>
<p>
<label for="password">Password: </label><input type ="password" name="password" value="" id="password">
</p>
<p><input type="submit" value="Login"></p>
</form>