Do you have a question? Post it now! No Registration Necessary. Now with pictures!
July 19, 2004, 2:09 pm
rate this thread
theory is to check to see if a user is "logged in" at the top of a
page, and if not, redirect them to a login page.
A typical web page will look like this:
<p>Secure Content Here</p>
The secure.php file looks like this:
$schema = $_SERVER['SERVER_PORT'] == '443' ? 'https' : 'http';
// Check to see if the user is logged in.
if (! isset($_SESSION["userid"]))
header("Location: " . $schema .
This all works fine in ASP. In PHP, however, I can't seem to get the
redirect to work. If I just type the secure.php URL directly into the
browser's address bar, it will redirect properly. If I call the page
I want to secure (either with a .html or a .php extension), it just
seems to ignore the redirect.
Any idea why?