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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux