--- Scott Fletcher <[EMAIL PROTECTED]> wrote: > session_start(); > > print_r($_SESSION); > //This one work because it spitted out datas from previous webpage > > echo (!(is_array($_SESSION))); > //This spitted out result as a blank
This is because echo deals with strings. The boolean false is the empty string when converted. Because $_SESSION is an array, your is_array() returns true, and your not (!) makes the expression false. > echo empty($_SESSION[USER_ID]); > //This spitted out result as "1" Because you have not set this variable (at least, not in the code you provided), empty() returns true. The boolean true will be output as 1. > echo empty($_SESSION[CUSTOMER_ID]); > //This spitted out result as a blank This means $_SESSION['CUSTOMER_ID'] is not empty. > echo empty($_SESSION[USER_LOGON1]); > //This spitted out result as "1" This means $_SESSION['USER_LOGON1'] is empty. > echo empty($_SESSION['PHPSESSID']); > //This spitted out result as "1" This means $_SESSION['PHPSESSID'] is empty. > I have no idea what is the problem here. Do my comments help? If you are wondering why some things are defined and others are not, please show us the output of print_r() in addition to these conditional statements, and we can compare the results. Otherwise, we have to assume that your conditional statements are working as expected. Hope that helps. Chris ===== Chris Shiflett - http://shiflett.org/ PHP Security Handbook Coming mid-2004 HTTP Developer's Handbook http://httphandbook.org/ RAMP Training Courses http://www.nyphp.org/ramp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php