I am trying to link a make a login page using php without database but the link to the other page is not working . It is staying on the same page. No error message also.
Here is the php part of the code:
<?php
$error = "";
if(isset($_POST['MRDlogin']))
{
if(isset($_POST['username'],$_POST['password'])){
/*** You can change username & password ***/
$user = array(
"user" => "MRD",
"pass"=>"msit"
);
$username = $_POST['username'];
$pass = $_POST['password'];
if($username == $user['user'] && $pass == $user['pass']){
header("Location: http://localhost/portal/MRD.php");
}else{
$error = '<div class="alert alert-danger">Invalid Login</div>';
}
}
}
and my html form part is:
> <div class="panel-body">
> <?php echo $error; ?>
> <form accept-charset="UTF-8" role="form" method="post">
> <fieldset>
> <div class="form-group">
> <input class="form-control" placeholder="Username" name="username" type="text">
> </div>
> <div class="form-group">
> <input class="form-control" placeholder="Password" name="password" type="password" value="">
> </div>
> <input class="btn btn-lg btn-success btn-block" type="submit" value="Login">
> </fieldset>
> </form>
> </div>