Page 1 of 1

Little PHP hacks for redirection on admin console

Posted: Tue Mar 22, 2005 12:25 am
by grima
I've slightly modified admin/login.php and admin/logout.php since i find the redirection page a little annoying, so here is the mod :

logout.php, replaced :
        echo ('Logging in... please waitLog
ging out.  Redirecting to login page...');

with :

if (!headers_sent())
{
        header("HTTP/1.1 302 Found");
        header("Location: ./index.php");
        exit();
} else {
        echo ('Logging in... please waitLog
ging out.  Redirecting to login page...');
}


the same code apply on login.php (with modification of the url of course).

Re: Little PHP hacks for redirection on admin console

Posted: Tue Mar 22, 2005 1:40 am
by Ted
That is what it did originally.  However, it gave a bunch of problems with IIS, so I redid it the other way.  Apparently you can't set cookies and redirect in the same request...  That was the best workaround I could come up with.