I have a problem with this code. Apparently when I run at Localhost the code run well. But when I put it online, it only read second and last statement only.
here's the code:
$a = $_SESSION['login_employee_no'];
$sql = "SELECT * FROM table WHERE id='$id'";
$result = mysqli_query($link,$sql);
$row = mysqli_fetch_assoc($result);
$authno = $row['authno'];
$supervisor = $row['supervisor'];
if ($a == $authno && $supervisor !== ""){
echo "<script>alert('Already verified by $supervisor ;(');
document.location='javascript:history.go(-1)'</script>";
}
else if ($authno == "") {
echo "<script>window.location.href='workpack-add-remarks-user.php?id=$id'</script>";
}
else if ($authno == $a) {
echo "<script>window.location.href='workpack-add-remarks-user.php?id=$id'</script>";
}
else if ($authno !== $a) {
echo "<script>alert('Id not same ;(');
document.location='javascript:history.go(-1)'</script>";
}
Supposedly, when user have the same ID with $authno, it should go to the next page but it echo "id not same".
I appreciate your help.