Michael Jonsson wrote:
Hi

Why do I get an error if the $_SESSION['user_status'] is NULL ???


####Script###### session_start(); echo $_SESSION['user_status'];


#####error######
Notice: Undefined index: user_status in /var/www/itmdata/include/include.php on line 13




Regards
Micke



That's not an error.  Three ways to solve this...

1)  Turn down your error reporting level.
2)  Declare your variables before using them

$_SESSION['user_status'] = NULL;
echo ( $_SESSION['user_status'] );

3)  Code for variables that may not exist

if ( isset ( $_SESSION['user_status'] ) ) {
        echo ( $_SESSION['user_status'] );
}

Or any combination of the three.

--
John C. Nichel
KegWorks.com
716.856.9675
[EMAIL PROTECTED]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to