I am very new to all this and have spent the last few hours looking at multiple sections of code on various pages. I am trying to pass a single variable from a PHP page to a javascript function page. The PHP variable will be filled from a database entry. On the javascript function page, I am going to use the variable in an if statement to decide what to do. Below is the section of code I have in the PHP file.
if($UserName == $username && $UserPass == $password){
$_SESSION['useris'] = $UserID;
$_SESSION['access_level'] = $Authlevel;
echo json_encode($Authlevel);
header('Location:../HTML/AdminModal.html'); //removed for testing of the auth level
}
I do not think that I have actually sent the data anywhere as yet.
Then in the javascript file, I am totally lost as to how to get the information I have passed.
I know there is a lot of big examples of various data being passed back and forth but I am struggling to understand or work out how to adapt to my needs.
Thanks