I have this code in my html file which is rendered by PHP:
<div>
<?php if($SESSION.userName=='UNSET'): ?>
User is not logged in
<?php else: ?>
user is logged in: user name is: {{ @SESSION.userName }}
<?php endif; ?>
</div>
<div> test {{ @SESSION.userName }}
</div>
The above code generates this output:
User is not logged in user is logged in: user name is: a
test a
This apparently means that the if statement is not calculated.
What is the problem and how I can fix it? I am new to PHP (just started today!)
Note: logged username is a
Edit1
The page is rendered using this function from an index.php file:
$f3->route(
'GET @home:/',
function ($f3) {
$f3->set('html_title', 'MyServer');
$f3->set('content', 'index.html');
echo Template::instance()->render('layout.php');
}