This is login code with session. Iam using bootstrap.The code is not redirecting to index.html, when I test it in Postman it works but it is not working in this bootstrap template. I didnt get the reason? Please Help
<?php
if($_SERVER["REQUEST_METHOD"]=="POST") {
$email=$_POST["email"];
$password=$_POST["password"];
$sql = "SELECT * FROM login where email='$email' and password='$password'";
$result = mysqli_query($conn,$sql);
$row=mysqli_fetch_array($result,MYSQLI_ASSOC);
$count = mysqli_num_rows($result);
if ($count>0) {
// output data of each row
if($row['admin_role']==1) {
//$_SESSION["email"]=$email;
//$_SESSION["id"]=$row['user_id'];
//echo "Login successfull";
header('Location: index.html');
exit;
}
} else {
echo "0 results";
}
}
?>
<div class="row">
<div class="col-xs-10 col-xs-offset-1 col-sm-8 col-sm-offset-2 col-md-4 col-md-offset-4">
<div class="login-panel panel panel-default">
<div class="panel-heading"> Admin Log in</div>
<div class="panel-body">
<form role="form">
<fieldset>
<div class="form-group">
<input class="form-control" placeholder="E-mail" name="email" type="email" autofocus="">
</div>
<div class="form-group">
<input class="form-control" placeholder="Password" name="password" type="password" value="">
</div>
<div class="checkbox">
<label>
<input name="remember" type="checkbox" value="Remember Me">Remember Me
</label>
</div>
<a href="" class="btn btn-primary">Login</a>
</fieldset>
</form>
</div>
</div>
</div><!-- /.col-->
</div><!-- /.row -->