I built a authentication database with MySQL 5.0.3 and PHP 4.3.12 dev using Apache2 and when I get to login page and submit my user and pass the database sees my authentication, but then i am supposed to go to anoth session of the site. Instead the login session keeps looping back to login again. I need help...
Thanks
Index.php
<?php
session_start();
if ((isset($SESSION['admin_logged']) &&
$SESSION['admin_logged'] != "") ||
(isset($SESSION['admin_password']) &&
$SESSION['admin_password'] != "")) {
include "logged_admin.php";
} else {
include "unlogged_admin.php";
}
?>
Conn.inc.php
<?php
$conn = mysql_connect("localhost", "some_user", "some_pass")
or die(mysql_error());
$db = mysql_select_db("some_db")
or die(mysql_error());
?>
Auth_admin.php
<?php
if ((isset($SESSION['admin_logged']) &&
$SESSION['admin_logged']) != "" ||
(isset($SESSION['admin_password']) &&
$SESSION['admin_password'] != "")) {
//Do Nothing!
} else {
$redirect = $_SERVER['PHP_SELF'];
header("Refresh: 5; URL=admin_login.php?redirect=$redirect");
echo "You are currently not logged in, we are redirecting you, " .
"be patient!<br>";
echo "(If your browser doesn't support this, " .
"<a href=\"admin_login.php?redirect\">Click here</a>";
die();
}
?>