@Dreeass..... I'm kind of lost on what you're saying. I looked at my code and don't see anything like the code you listed... could you point it out to me and elaborate a little more on what that means and how it will change it?... I've updated my code so I'm re-posting it in here.. now I'm getting a "404 Page Not Found" error...
Code:
<?php
session_start();
if(!isset($_SESSION["manager"])){
header("location:'http://www.optiq-customtees.zxq.net/storeadmin/index.php'");
exit();
}
?>
<?php
//Parse the log in form if the user has filled it out and pressed "Log In"
if(isset($_POST["username"])&&isset($POST["password"])){
$manager=preg_replace('#[^A-Za-z0-9_]#i','',$_POST["username"]);//filter everything but numbers and letters
$password=preg_replace('#[^A-Za-z0-9]#i','',$_POST["password"]);//filter everything but numbers and letters
//Connect to the MySQL database
include"http://www.optiq-customtees.zxq.net/storeadmin/connect_to_mysql.php";
$sql=mysql_query("SELECT id FROM admin WHERE username='$manager' AND password='$password' LIMIT 1");//query the person
//---- MAKE SURE PERSON EXISTS IN DATABASEE ----
$existCount=mysql_num_rows($sql);//count rows nums
if($existCount==1){//evaluate the count
while($row=mysql_fetch_array($sql)){
$id=$row["id"];
}
$_SESSION["id"]=$id;
$_SESSION["manager"]=$manager;
$_SESSION["password"]=$password;
header("location:http://www.optiq-customtees.zxq.net/storeadmin/index.php");
exit();
}else{
echo'That information is incorrect, try again <a href="http://www.optiq-customtees.zxq.net/storeadmin/index.php">Click Here</a>';
exit();}}?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Store admin</title>
<link rel="http://www.optiq-customtees.zhq.net/style/style.css" type="text/css" />
</head>
<body>
<div align="center" id="mainWrapper">
<?php include_once("http://www.optiq-customtees.zxq.net/template_header.php");?>
<div id="pageContent"><br />
<div align="left" style="margin-left:24px;">
<h2>Please Log In To Manage Store</h2>
<form id="form1" method="post" action="admin_login.php">
User Name:<br />
<input name="username" type="text" id="username" size="40" />
<br /><br />
Password:<br />
<input name="password" type="password" id="password" size="40" />
<br />
<br />
<br />
<input type="submit" name="button" id="button" value="Log In" />
</form>
<p> </p>
</div>
</div>
<br />
<br />
<?php include_once("http://www.optiq-customtees.zxq.net/template_footer.php");?>
</div>
</body>
</html>
Bookmarks