Originally posted by planetsim
Doesnt Always work that one.. Pretty sure it says it in the Manual.
Anyways try this
if(empty($SERVER['HTTP_REFERER']))
{
$SERVER['HTTP_REFERER'] = "Direct Hit";
}
echo $_SERVER['HTTP_REFERER'];
Well that will work to mark that there's no referer, but what I'm looking to do is thus:
I have a page with admin functions on it that will come up and ask for login information (from an included file that checks if permission is there and displays the login if not). It then sends the login info to a script called login.php.
Here's the included file (admin.inc.php):
<?
if ($_SESSION['authuser'] != 1)
{
?>
<center>
<font color="red">You are not authorized to view this page. Please log in below.</font><br>
<table width="300">
<form method="post" action="login.php">
<tr><td align="right">Username:</td>
<td align="left"><input type="text" name="username"></td></tr>
<tr><td align="right">Password:</td>
<td align="left"><input type="password" name="password"></td></tr>
<tr><td align="center" colspan="2"><input type="submit" value="login"></td></tr>
</form>
</table>
</center>
</body>
</html>
<?
exit;
}
?>
What I want login.php to do is detect what page the login information came from and redirect to that page if the login passes.
Originally I had set the permission check within each page itself and set a session variable with that page's address on it but that was rather inefficient. Any ideas?