RE: [PHP] Redirect then error message to user

From: Date: Fri, 22 Oct 2004 18:38:24 +0000
Subject: RE: [PHP] Redirect then error message to user
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-200110@lists.php.net to get a copy of this message
This isn't working: Page2 (after page1 has been posted): else { $_SESSION['er'] = 'Please make sure to fill in all 3 corresponding values .........'; header("Location: http://www.xxxxx.com/TestMulti4a.php" ); exit; } } Page1: Opening after session_start $_SESSION['er'] = $_POST['er']; Then below in form area: print $er; (tried also echo) Am I do something wrong ? Stuart --- Jay Blanchard <jay.blanchard@niicommunications.com> wrote: > [snip] > { > header("Location: > http://www.xxxxxx.com/page1.php" > ); > print "You have errors"; > exit; > } > > } > [/snip] > > You either need to carry info about the error in a > session variable or > url string or something...above your redirect > happens before any error > can be sent to the browser.... >

« previous php.general (#200110) next »