Thanks for the quick reply. I love this board. Anyway, what you suggested is exactly what I had in mind. I would like to show my code
session_start();
require_once('Connections/Holocron.php');
$referer = $_SERVER['HTTP_REFERER'];
$user = $_POST['username'];
$password = $_POST['password'];
mysql_select_db($database_Holocron, $Holocron);
$query = mysql_query("SELECT * FROM users WHERE Username = '$user'");
$data = mysql_fetch_object($query);
$stored_pass = $data->Password;
if ($stored_pass == $password)
{
$query2 = mysql_query("SELECT rolename FROM user_roles WHERE Username = '$user'");
$data2 = mysql_fetch_object($query2);
$_SESSION['loggedin'] = 1;
$_SESSION['role'] = $data2->rolename;
echo $referer . "<BR>";
echo "Logging you in $user with role $data2->rolename. Please wait...";
echo "<meta http-equiv='refresh' content='3;URL='" . $referer . "'>";
}
else
{
header("Location:login.php?failed=true");
}
Now what happens, I know I am getting the correct referer because I am echo-ing it out onto the screen. But for some reason, it is not going back to that page. It is just recalling the same page I am on over and over because it just keeps doing the <meta> tag over and over. Any suggestions?
Thanks.
Gregg