Hi guys wondering if I can get some help...
Ive just started doing a small e commerce site.
I have tried to to setup a simple form where the user would enter details and login. However, I am getting this message when trying to view my page in a browser.
"Parse error: syntax error, unexpected T_EXIT in C:####################\admin_login.php on line 5"
Here is the code:
Thanks before hand for any help, much appreciated.
<?php
session_start();
if(!isset($_SESSION["manager"])){
header("location: index_store_admin.php")
exit();
}
?>
<?php
// Run script after user has clicked 'log in'
if (isset($_POST["username"]) && isset($_POST["password"])) {
$manager = preg_replace('#[^A-Za-z0-9]#i', '', $_POST["username"]);
$password = preg_replace('#[^A-Za-z0-9]#i', '', $_POST["password"]);
// Connecting to database
include "/Scripts/Connection_MySQL.php";
$sql = mysql_query("SELECT id FROM tblAdmin WHERE username='$manager' AND password='$password' LIMIT 1"); // query the person
//Ensuring user existence
$existCount = mysql_num_rows($sql);
if ($existCount == 1) {
while($row = mysql_fetch_array($sql)){
$id = $row["id"];
}
$_SESSION["id"] = $id;
$_SESSION["manager"] = $manager;
$_SESSION["password"] = $password;
header("location: index.php");
exit();
} else {
echo 'That information is incorrect, try again <a href="index.php">Click Here</a>';
exit();
}
}
?>