Secure website
Posted: Thu Jan 06, 2011 3:46 pm
This might belong in PHP - Security but oh well.
So basically, I'm trying to make a website with a login system. The system sets $_SESSION['login'] = 1 if the client logs in correctly. That works fine.
The problem is that the secure pages each contain a crapload of HTML code that I really don't want to have to cram into an echo (see below).
Currently, my site redirects people who aren't logged in (see below), but that's obviously not secure. It allows them to see the pages for a fraction of a second. Which is not okay.
tl;dr; is there any way I can protect my web pages without having to echo their entire contents through PHP?
So basically, I'm trying to make a website with a login system. The system sets $_SESSION['login'] = 1 if the client logs in correctly. That works fine.
The problem is that the secure pages each contain a crapload of HTML code that I really don't want to have to cram into an echo (see below).
Code: Select all
if(!$_SESSION['login'])
{
REDIRECT
}
else
{
echo('HUNDREDS OF LINES OF HTML');
}
Code: Select all
if(!$_SESSION['login'])
{
REDIRECT
}
<html>....