01-23-2010, 05:41 PM
|
#6 (permalink)
|
|
The Wanderer
Join Date: Aug 2009
Posts: 17
Thanks: 0
|
Basically what that warning is saying is that your trying to use an index of an array in a statement before you have actually defined the index.
So there are two ways you could overcome this. The first is the code that Parvus posted and the second way is by setting a default value for that index if it hasn't already been set yet (this method is better if you are referencing the index many times throughout your scripts.
PHP Code:
if (!isset($_SESSION['login'])) { $_SESSION['login'] = 'false'; // change to whatever default value you want }
// ...
if ($_SESSION['login'] == 'true') { // ... }
|
|
|
|