RE: [PHP] Am I blind? simple 15 line code producing error - SOLUTION FOUND! - tks

2002-11-04 Thread Paul
To those of you that helped me with this problem I have spent time
eliminating lines of code.. the problem was in the following line:
if ($_SESSION[first_name])

the line should be like this
if (ISSET($_SESSION[first_name]))

Seems like ISSET made a difference in eliminating warning: Cannot add
header information. The code worked before but I guess it was broken
once Global Vars were turned off in the resent version of PHP

Thank you to all the replies

Paul



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




RE: [PHP] Am I blind? simple 15 line code producing error - SOLUTION FOUND! - tks

2002-11-04 Thread David Freeman

  To those of you that helped me with this problem I have spent time
  eliminating lines of code.. the problem was in the following line:
  if ($_SESSION[first_name])
  
  the line should be like this
  if (ISSET($_SESSION[first_name]))

The change that would induce this error is likely to be related to error
reporting.  What you'll probably find if you delve into it is that in
the first case above, if the var wasn't set there was an error notifying
you of that.  In the second case above, using isset() would avoid that
error message being displayed.

The error you were having was because your code was displaying an error
message to the browser which would automatically mean that something had
been sent to the browser and it would no longer be possible to add
header information.

If you couldn't see the error relating to checking the var it's likely
something to do with display settings for your html - eg. displaying
white text on a white background.

CYA, Dave




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