How easy is it to redirect users? This forum does it, so I've been playing around but can't get it to work. At the moment if the user tries to access a secure page and they are not logged in they get redirected to the login page and are told to login.
Now in the address bar I have got it so that it collects the data of the page they tried to access. For example if they were trying to access the page "hello.php" in the "members" folder the URL would look like this:
login.php?message=1&forward=1&redirect=/members/hello.php
I've got the following code for my login script to try and take them to the $redirect info.
#Check For Forwarding
if ($forward=="")
{
header("Location: members/$redirect");
}
else
{
header("Location: members/welcome.php");
}
It returns the URL:
members/index.php
Haven't got a clue, but would be VERY useful to be able to do this, would help my users immensely.
Cheers,
Chris