for some of my php pages, i use the $_SESSION to determine if a user is signed in, the code is:
if(isset($_SESSION['USERID'])&&$_SESSION['USERID']>=0&&is_numeric($_SESSION['USERID']));
for whatever reason, this if statement is being ignored, I have tested the $_SESSION to make sure that the value is empty by trying
$session=$_SESSION['USERID']; echo"$session"; the result is blank.
now at the end of php file i want to use an else follow the closing if bracket, this is creating the error of:
Parse error: syntax error, unexpected T_ELSE
This is extremely frustrating, why would this occur?
You’ve got a semicolon after your
if. Take it out, and it won’t be ignored, plus yourelsewill work.