Re: Redirection with header (was Re: [PHP] Cookies and sent headers)

From: Date: Sun, 19 Aug 2007 16:28:48 +0000
Subject: Re: Redirection with header (was Re: [PHP] Cookies and sent headers)
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-261015@lists.php.net to get a copy of this message
At 8:52 AM +0200 8/19/07, Otto Wyss wrote:
In my case I could easilly do without redirection but just exit and fall back on the calling page. Yet I want to remove the login page from the browser history. Does the header function have the same effect?
O. Wyss: Instead of messing with the user's browser (not good IMO), why not use $_SESSION and make it such that if the user selects the log-on page again, they are redirected to another page? You don't even need header() to do that. Here's an example: http://webbytedd.com/bb/one-time You will only see that page only once -- unless you find a way to clear the session. The process is simply to set a session variable and allow the user to see the page once. Upon returning, the session variable is checked and if it is "not null", then the user is redirected to another page like so: if($visit != null) { ob_clean(); include('a.php'); exit(0); } Very simple. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com

« previous php.general (#261015) next »