Thanks for jogging my memory.  Found the problem, I forgot to increment the
column count on the odbc_result so, left the rest of the column off by 1
count when I added 6 columns (odbc_result) to the $_SESSION.  How goofy of
me!

Anyway, I first thought that data returned as blank meant something is wrong
with the script.  But hey, wouldn't it make more sense if the output can be
either "1 or 0" instead of "1 or blank", it would help to make life be made
easier because we forget that a blank can also meant false....

Thanks,
  Scott F.

"Chris Shiflett" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> --- 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

Reply via email to