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



What you're proposing, is to actually display some content on another page
then were the content is originally intended? I'm sorry, but I would
consider that 'bad practice'. To me, it makes perfect sense that you don't
want to leave the user on the page where login was originally handled. For
various reasons. One very obvious would be the 'refresh thing', where your
browser asks the user if they want to send the form again. Quite annoying.
Then, what about bookmarks? ...

I would definately go for the Location: header solution!

On 19/08/07, tedd <tedd@xxxxxxxxxxxx> wrote:

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




--
Interpotential.com
Phone: +31615397471


Relevant Pages

  • Re: IE wont display gif created by GD threw php.
    ... Why won't it display in IE? ... the shebang is not needed when running under a web browser - and in fact can cause problems. ... If i put a gif or any file in a directory i can access it without the header command. ...
    (comp.lang.php)
  • Re: IIS basic authentication login prompt - 3 attempts
    ... IIS does not throw this error - the browser does. ... This causes the browser to display a login box. ...
    (microsoft.public.inetserver.iis)
  • Re: Delay page - how?
    ... Bounce to next page is not possible using header, ... So the flushwill make the advert HTML display, ... > suppose the browser icon will keep spinning. ...
    (comp.lang.php)
  • Re: Login / Password
    ... user for a name & password if the session variable IDUser is not set. ... How do I get the browser to display the login / password dialog and ...
    (comp.lang.php)
  • Re: headers help
    ... I want to force the browser to display the query string that a ... > header points it to. ... > the location in the browser shows ...
    (comp.lang.php)