I am trying to use header()
in my page on real server but it does not work. If I try it in Xammp on localhost it works fine.
if(empty($_POST)===false){
include_once("db.php");
$username = $_POST['user'];
$pwd = $_POST['pwd'];
$rs = mysqli_query($con,"select *from admin_acc where username = '".$username."'");
$num_rows = mysqli_num_rows($rs);
if($num_rows > 0){
while($rows = mysqli_fetch_assoc($rs))
{
$db_username = $rows['username'];
}
if($username == $db_username && md5($pwd) == $db_password){
$_SESSION['username'] = $db_username;
//Header to Home Page
header('Location: customers.php');
}else{
$wrng_pwd = "Wrong Password!";
$msg_type = 1;
}
}else{
$user_nt = "User name not exsit!!";
$msg_type = 2;
}
}
So can you please help me?