Little PHP hacks for redirection on admin console

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
grima

Little PHP hacks for redirection on admin console

Post 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).
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm

Re: Little PHP hacks for redirection on admin console

Post 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.
Post Reply

Return to “Developers Discussion”