I was given this code to place in my php pages to use as a form of page protection. Meaning after a user logins in, they can visit certain pages and a person not logged in will automatically be sent to the login page.
But it is not working. The site does have certain directories now protected by htaccess and there is an htmaster file. I tried using a directory that was not being protected by htacces, but it still does not work. Here is the code...
[<?php
if(!@$_SESSION["UserID"])
{
$_SESSION["MyURL"]=$_SERVER["SCRIPT_NAME"]."?".$_SERVER["QUERY_STRING"];
header("Location: login.php?message=expired");
return;
}
?>]
without the brackets of course.
This code is also in most if not all of the normal php pages created by PHPRunner.
The rest of the page is just regular html and this code is placed at the very top of the page.
Anyone know why this does not work?
Thanks.
Gene