Page 1 of 1

fatal error syntax error

Posted: Tue Nov 26, 2019 9:45 pm
by Markacrum
I get this Error: fatal error syntax error, unexpected 'is' (t_string) on line number 2
Sorry I am new at this. Everything was fine and not sure what changed Here is php code:

<?php
if (session_id() == "")
{
session_start();
}
if (session_id() == "")
{
session_start();
}
if (!isset($_SESSION['username']))
{
$_SESSION['referrer'] = $_SERVER['REQUEST_URI'];
header('Location: ./sorry.php');
exit;
}
if (isset($_SESSION['expires_by']))
{
$expires_by = intval($_SESSION['expires_by']);
if (time() < $expires_by)
{
$_SESSION['expires_by'] = time() + intval($_SESSION['expires_timeout']);
}
else
{
unset($_SESSION['username']);
unset($_SESSION['expires_by']);
unset($_SESSION['expires_timeout']);
$_SESSION['referrer'] = $_SERVER['REQUEST_URI'];
header('Location: ./sorry.php');
exit;
}
}
$roles = array("Administrator", "Member", "Guest");
if (!in_array($_SESSION['role'], $roles))
{
header('Location: ./sorry.php');
exit;
}
?>

Re: fatal error syntax error

Posted: Wed Nov 27, 2019 7:04 am
by Pablo
I do not see any error in the code.
Are you sure this is the code that is causing the error?

Re: fatal error syntax error

Posted: Tue Dec 03, 2019 8:54 pm
by Markacrum
No,

Just do not know where to look!

Re: fatal error syntax error

Posted: Tue Dec 03, 2019 9:13 pm
by Pablo
What is the code of the entire page?
Or do you have a demo project?