My header redirect is not working on the live server but its work on my localhost,but using the script it redirected to the desired page
This is is my code
<?php
include('config.php');
session_start();
if(isset($_POST['login']))
{
$user=$_POST['uname'];
$pass=$_POST['pwd'];
$log=" select * from user where UserName='$user' AND Password='$pass' ";
$in=mysql_query($log,$con) or die(mysql_error());
$res=mysql_num_rows($in);
if($res==1)
{
$_SESSION['id']=mysql_result($res,0);
header('Location:dashboard.php');
//echo "<script type='text/javascript'>location.href = 'dashboard.php';</script>";
}
else
{
echo "<script>alert('Invalid Login')</script>" ;
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>RESTAURANT</title>
<!-- Google Fonts -->
<link href='https://fonts.googleapis.com/css?family=Roboto+Slab:400,100,300,700|Lato:400,100,300,700,900' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="css/animate.css">
<!-- Custom Stylesheet -->
<link rel="stylesheet" href="css/style.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
</head>
<body>
<div class="container">
<div class="login-box animated fadeInUp">
<div class="box-header">
<h2>Log In</h2>
</div>
<form action="" method="post">
<label for="username">Username</label>
<br/>
<input name="uname" type="text" id="username" >
<br/>
<label for="password">Password</label>
<br/>
<input name="pwd" type="password" id="password">
<br/>
<button name="login" type="submit">Log In</button>
<br/>
</form>
<!--<a href="#"><p class="small">Forgot your password?</p></a>-->
</div>
</div>
</body>