Brief background to this question: my hosting provider has just decided to switch on NOTICES reporting, so my site is now swamped with lots of "Notice: Undefined index" messages.
I've worked out how to get rid of these messages (by over-riding the php.ini settings of course!) but I'm now trying to fix the code that's generated these messages and run into a problem with isset(). Having looked at the PHP manual, I'm aware that isset() is only supposed to be used to check variables but I'm using this code in my pages and it doesn't generate any NOTICES or cause any problems:
Code: Select all
if(!isset($_SESSION['user_id'])) isset($_SESSION['user_id']);
$_SESSION['user_id'] = $user_id;Thanks,
Mecha Godzilla