$current_page = "login"; // stop send to login loop include("includes/globals.php"); IF($logged_in == "yes") { // just go to index if logged in header("Location:index.php"); exit; } IF( ( $_REQUEST["login_submit"] ) && ( $_REQUEST["login_user"] == "" ) ) { header("Location:login.php?code=1"); exit; }ELSEIF(( $_REQUEST["login_submit"] ) && ( $_REQUEST["login_pass"] == "" )) { header("Location:login.php?code=1"); exit; }ELSEIF(( $_REQUEST["login_submit"] ) && ($_REQUEST["login_user"] == $admin_username) && ($_REQUEST["login_pass"] == $admin_password)) { $result = MYSQL_QUERY(" INSERT INTO session (session_id, session_date, session_ip) VALUES ('" .session_id()."','$today','$ip') "); $result = MYSQL_QUERY(" SELECT id FROM session WHERE session_id = '" .session_id()."' "); $row = MYSQL_FETCH_ARRAY($result); $_SESSION['logged_in'] = "yes"; $_SESSION['session_id'] = $row[id]; header("Location:index.php"); exit; }ELSEIF(($login_submit)&&(($login_user != $admin_username)||($login_pass != $admin_password))) { header("Location:login.php?code=2"); exit; } #translate codes IF($_REQUEST["code"] == "1") { $message = "
Error: One Or More Feilds Blank - please try again
\n"; }ELSEIF($_REQUEST["code"] == "2") { $message = "Error: Invalid Information - please try again
\n"; } $title = "Watson Printing"; include("includes/page_begin.php"); ?>Welcome to the Watson Printing client login section. Please enter your information below.
echo $message; ?>include("includes/page_end.php"); ?>