i have a login form setup that redirects to another page once the person has successfully logged in. Im new to PHP and would like to set a session variable to prevent users from access the page directly via URL
For example:
The form directs to mydomain.com/supportarea/index.php
I’ve read about using session variables to track the last page. so on the form page i have the following code:
[CODE]
<?
session_start();
$_SESSION[‘lastpage’]=login;
}
?>
My question is, on the page that i am redirecting to, how to i use this variable?
What i would like to do is something along the lines of, if $_SESSION[‘lastpage’]=login; then allow them to the page, if not, send them to the login page
Thanks for any help.