Currently I’m trying to make it so if someone logs in his the same id as the php $ variable then it will redirect them. although I am not sure why it isn’t working.
$query = “SELECT * FROM login WHERE username= '”.$_SESSION[‘username’]."’";
$result = $connection->query($query);
if($result->num_rows > 0){
$userData = $result->fetch_assoc();
if($userData[‘id’] = $siteokid){
header(“Location: admin.php”);
}
}else{
session_destroy();
header("Location: index.php ");
echo “”;
}