Tips to improve my simple member login.

Associate
Joined
11 Oct 2008
Posts
268
Hey guys,

I currently have a very simple members area, I was wondering if anyone could give me any tips on how to improve it. It basically works like this.

if session exist

echo <<<adminarea

admin control panel here

adminarea;

else

echo <<<loginpage

etc etc.

That works fine for what I need but If I ever want to expand it, I'm rather limited by the fact everythings contained in the one heredoc.

I have tried re-directing the page if the session doesn't exists but it still flashes a glimpse of the content page before it does.

Any tips on how I should be securing the admin page ?

Thanks for any help
 
Associate
OP
Joined
11 Oct 2008
Posts
268
I think its just the re-direct being too slow.

I was using

PHP:
<?php

    if (!isset($_SESSION['username'])) {

  
echo <<<FORM

<script>
    function reloadPage() {
    window.location.assign("?nav=login")
    }
</script>

<body onload="reloadPage()">

FORM;
}

?>
 
Associate
OP
Joined
11 Oct 2008
Posts
268
The only thing that I had issues with using header, was that It needs to be executed before any html. So if I call the admin page within my layout it gives me an error.
 
Back
Top Bottom