This statement works fine if I only use it once, but not when I need to use it several times. I’m curious as to why, but more importantly I would like to know how I can get around that.
<?php if (isset($_SESSION['SESS_USER_ID'])) { ?>
<?php }
else {?>
<?php }
I need to change several items on the page depending upon whether or not the user is logged in (menu items, messages to the user, etc.)
Quick way around it would be:
then
BUT
There is something wrong going on between the first time you access
$_SESSIONand the second time. You are accidentally setting it somewhere (using=instead of==is an easy way), or you have code with side-effects that is changing it behind the scenes.