session_start(); header("Cache-control: private"); @$linkid = mysql_connect("localhost", "root", "sql2004"); @mysql_select_db("carperfect", $linkid); //debugging purposes halabuda@gmail.com //$linkid = mysql_connect('localhost', 'root', 'sql2004') or die (mysql_error()); //mysql_select_db("carperfect", $linkid) or die (mysql_error()); require 'error.php'; require 'define_functions.php'; require 'tracking_functions.php'; ?> // find if action is logout @$action = $_REQUEST['action']; // switch(@$action){ case 'logout': session_unregister("loggedin"); session_unregister("adminlevel"); session_unregister("username"); session_unregister("userid"); session_unregister("returnValue"); // $_SESSION['loggedin'] = false; header("Location:".$PHP_SELF); break; case 'process_login': // query for the username and find if they are allowed @$postPass = base64_encode($_REQUEST['pass']); @$postEmail = $_REQUEST['email']; if(!$postPass) error("*Error: The Password field is Required"); if(!$postEmail) error("*Error: The E-mail field is Required"); // if(count(@$error)==0){ $query = "SELECT * FROM users WHERE email = '$postEmail' AND pword = '$postPass'"; $result = mysql_query($query, $linkid); if(@mysql_num_rows($result)==0) error("*Error: Login Not Accepted. Please try again"); // while($row = mysql_fetch_object($result)){ // this user exists $_SESSION["loggedin"] = true; $_SESSION["adminlevel"] = $row->adminlevel; $_SESSION["username"] = $row->email; $_SESSION["userid"] = $row->id; // check where to go if(@$_SESSION["returnValue"]){ header("Location:http://www.carperfect.com/".$_SESSION["returnValue"]); }else{ if($_SESSION["adminlevel"] == "admin"){ header("Location:http://www.carperfect.com/admin.php"); ?> }else if($_SESSION["adminlevel"] == "user"){ if($postPass == "welcome"){ header("Location:http://www.carperfect.com/changepass.php"); ?> }else{ header("Location:http://www.carperfect.com/user.php"); ?> } }else if($_SESSION['adminlevel'] == 'data_entry'){ header('Location:Http://www.carperfect.com/data_entry.php'); } } } } break; } // function displayLogin($thispage){ if(@$_SESSION["loggedin"] != true){ ?>
Business Owners
Carperfect.com has developed a risk-free method to convert slow days into busy ones. By harnessing the incredible efficiencies and reach of the Internet, our programs serve to drive dirty cars to participating establishments, creating additional revenues, and repeat visits. Car Care News
updated last on =date("m.d.Y")?> |
=displaySearch()?> |
Your Questions Answered Common and not so common auto questions answered by auto industry professionals |
|
||||||||||||||||||||||||||||||