RE: [PHP] Problem with header in an if

From: Date: Thu, 24 Mar 2005 21:18:38 +0000
Subject: RE: [PHP] Problem with header in an if
Groups: php.general 
Request: Send a blank email to php-general+get-211524@lists.php.net to get a copy of this message
Jay Blanchard <mailto:jay.blanchard@niicommunications.com> on Thursday, March 24, 2005 1:00 PM said: > I have tried ... > 0 < count($errorsReported) > 0 != > 0 !== > isset($errorReported) > !empty > '' != > '' !== Have you tried explicitly setting $errorsReported to "" to see where it goes? $errorsReported = ""; if(!empty($errorsReported)) { // do loop } else { // do redirect } Also, are you sure your program is even GETTING that far? Maybe the program is stopping before the point in question. > And Chris, thanks for the heads up, I put the exit() and the FQDN in > there. In that case may I suggest the following function: function redirect($location) { header("Location: ".FQDN_CONSTANT."$location"); exit; } Makes things easier down the road. Chris.

« previous php.general (#211524) next »