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

From: Date: Mon, 04 Nov 2002 22:36:58 +0000
Subject: RE: [PHP] Am I blind? simple 15 line code producing error - SOLUTION FOUND! - tks
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-122716@lists.php.net to get a copy of this message
> 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

« previous php.general (#122716) next »