Done a login form using php mysql. Its working fine in windows plesk. Migrated from plesk windows to cpanel, header location redirect stopped working. However it check login with db
<?php
session_start();
if(isset($_POST['submit'])){
$name1=$_POST['username'];
$pass=$_POST['password'];
include("connection.php");
if ($stmt = $conn->prepare("SELECT id,username,password from login WHERE BINARY username = BINARY ? and BINARY password = BINARY ?")) {
$stmt->bind_param("ss", $name1,$pass);
$stmt->execute();
$stmt->bind_result($id,$name1,$pass);
if ($stmt->fetch())
{
$_SESSION['login']=1;
$_SESSION["loginname"] = $name1;
$_SESSION["idname"] = $id;
header("Location:dashboard.php");
}
else
{
?> <p class="text-center" style="margin-top:12px;color:red;"><b>Invalid Username / Password !</b></p>
<?php
}
}
}
?>
Help me sort out the issue.