Hi, so....i have these 2 pages, but they don't show up in browser....can't find the error so will ask your help guys
index.php
<?php
session_start();
if(!isset($_SESSION["manager"])){
header("Location: admin_login.php");
exit();
}
//Be sure to check that manager SESSION value is in database
$managerID = preg_replace('#[^0-9]#i',",$_SESSION["id"]); // Filter everything but numbers and letters
$manager = preg_replace('#[^A-Za-z0-9]#i',",$_SESSION["manager"]); //Filter everything but numbers and letters
$password = preg_replace('#[^A-Za-z0-9]#i',",$_SESSION["password"]); //Filter everything but numbers and letters
//Run MySQL query to be sure that this person is an admin and that their password session var equals the database
//Connect to the MySQL Database
include("../storescripts/connect_to_mysql.php");
$sql = mysql_query("SELECT * FROM admin WHERE id='$managerID AND username='$manager' AND password='$password' LIMIT 1"); //search user
$existsCount = mysql_num_rows($sql); //count the row numbers
if ($existsCount == 0){ //evaluate the count
header("Location: ../index.php");
exit();
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>MyOnlineStore | Admin Area</title>
<link rel="stylesheet" href="../style/style.css" type="text/css" media="screen"/>
</head>
<body>
<div align="center" id="mainWrapper">
<?php include_once("../template_header.php");?>
<p><br />
<br />
</p>
<p> </p>
<p><br />
</p>
<div id="pageContent">
<div id="admin" align="left">
<h3>Hello what you want to do?</h3>
<p><a href="#">Manage Inventory</a><br />
<a href="#">Manage afggagdfag</a></p>
</div>
</div>
<?php include_once("../template_footer.php");?>
</div>
<p> </p>
<p> </p>
<p> </p>
</body>
</html>
admin_login.php
<?php
session_start();
if(!isset($_SESSION["manager"])){
header("Location: admin_login.php");
exit();
}
//Be sure to check that manager SESSION value is in database
$managerID = preg_replace('#[^0-9]#i',",$_SESSION["id"]); // Filter everything but numbers and letters
$manager = preg_replace('#[^A-Za-z0-9]#i',",$_SESSION["manager"]); //Filter everything but numbers and letters
$password = preg_replace('#[^A-Za-z0-9]#i',",$_SESSION["password"]); //Filter everything but numbers and letters
//Run MySQL query to be sure that this person is an admin and that their password session var equals the database
//Connect to the MySQL Database
include("../storescripts/connect_to_mysql.php");
$sql = mysql_query("SELECT * FROM admin WHERE id='$managerID AND username='$manager' AND password='$password' LIMIT 1"); //search user
$existsCount = mysql_num_rows($sql); //count the row numbers
if ($existsCount == 0){ //evaluate the count
header("Location: ../index.php");
exit();
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>MyOnlineStore | Admin Area</title>
<link rel="stylesheet" href="../style/style.css" type="text/css" media="screen"/>
</head>
<body>
<div align="center" id="mainWrapper">
<?php include_once("../template_header.php");?>
<p><br />
<br />
</p>
<p> </p>
<p><br />
</p>
<div id="pageContent">
<div id="admin" align="left">
<h3>Hello what you want to do?</h3>
<p><a href="#">Manage Inventory</a><br />
<a href="#">Manage afggagdfag</a></p>
</div>
</div>
<?php include_once("../template_footer.php");?>
</div>
<p> </p>
<p> </p>
<p> </p>
</body>
</html>