hi.
If we say you browse to 'content.html',
which is a page you have and want to be secure.
I think one 'secure.php' has to be in same directory as 'content.html'.
Or eventually, 'secure.php' should be in doc_root of your site,
normally /htdocs/
Also notice, you can still use extension '.htm' (pagename.htm) for non-secure stuff.
What happens if you change 'secure.php' to using this code.
Nothing more, no header or no readfile.
Try, just use this, as your secure.php
<?php
session_start();
if( !isset($_SESSION['authorised']) ){
exit(
'<p>You are not authorised to access this content!</p>
<p>You can login <a href="login.php">here</a>.'
);
}
?>
'login.php' should of course have
<?php
session_start();
// if correct user/pass
$_SESSION['authorised'] = true;
?>