hey guys i have a problem with my admin login php. when i open the page, i get redirected to the admin login message that i have sent up and i am unable to get to the login page. i have two page, the first in the index.php which i am trying to access and the second is the admin_login.php page that should allow me to sign in.
i have a very funny feeling that it is something stupid that i am missing ( like a ; or bracket) so if someone could help me find the mistake i would be very grateful
here is the index.php
code[php]<?php
session_start();
if(!isset($_SESSION[“manager”])){
header(“location: admin_login.php”);
exit();
}
$managerID = preg_replace(’#[^0-9]#i’,’’, $_SESSION[“id”]);
$manager = preg_replace(’#[^A-Za-z0-9]#i’,’’, $_SESSION[“manager”]);
$password = preg_replace(’#[^A-Za-z0-9]#i’,’’,$_SESSION[“password”]);
include"http://http://localhost/test/connect_to_mysql.php";
$sql=mysql_query(“SELECT*FROM employee WHERE EmID =’$managerID’ and username = ‘$manager’ and password = ‘$password’ LIMIT 1”);
$existCount = mysql_num_rows($sql);
if ($existCount == 0){
echo “Your login session data is not in right”;
exit();
}
?>
and here is the admin_login.php code
[php]<?php
session_start();
if(isset($_SESSION[“manager”])){
header(“location: admin_login.php”);
exit();
}
?>
password:
Thanks in advance