"Error", 2 => "Warning", 4 => "Parsing Error", 8 => "Notice", 16 => "Core Error", 32 => "Core Warning", 64 => "Compile Error", 128 => "Compile Warning", 256 => "User Error", 512 => "User Warning", 1024 => "User Notice"); $errlevel=$errortype[$errno]; //Write error to log file (CSV format) $errfile=fopen("errors.csv","a"); fputs($errfile,"\"$time\",\"$filename: $linenum\",\"($errlevel) $errmsg\"\r\n"); fclose($errfile); //if($errno!=2 && $errno!=8) { //Terminate script if fatal error //die("A fatal error has occurred. Script execution has been aborted"); //} } Function DoLogin($Username, $Password, $RememberMe = False, $EN = False) { If ($EN == False) { $MD5Salt = "LoveSnap"; $Password = MD5($Password.$MD5Salt); //Echo " .Encrypted Entry. "; } If ($RememberMe = True) { setcookie("RUsername", $Username, time()+(60*60*24*30)); setcookie("RPassword", $Password, time()+(60*60*24*30)); setcookie("DoLogin", "True", time()+(60*60*24*30)); } //Echo "Logging in..."; $sql = "SELECT `ID`, `Username`, `Password`, `Status` FROM `USERS` WHERE `Username` = '$Username' AND `Password` = '$Password'"; $result = mysql_query($sql); If (mysql_num_rows($result) == 0) { Return "Error username/password did not match"; } Else { $theID = mysql_result($result, 0, 'ID'); $Username = mysql_result($result, 0, 'Username'); $Password = mysql_result($result, 0, 'Password'); $Status = mysql_result($result, 0, 'Status'); $Pepper = "MyPepperWuvsMe!@#$1234"; $_SESSION['accepted'] = 1; //If 'remember me' use this for cookie password $_SESSION['passcode'] = MD5($Password.$Pepper.$Username); $_SESSION['userID'] = $theID; $_SESSION['displayName'] = $Username; $_SESSION['status'] = $Status; $sql = "UPDATE `USERS` SET `Last_Logon` = ".Time()." WHERE `ID` = $theID LIMIT 1"; $result = mysql_query($sql); return 1; exit; } } Function CheckAuth($page) { //!! if ($_SESSION['Accepted'] == 1) { return true; } else { //DoRedirect("Logging you in...", "$mydomain?page=login&ref=$mydomain$page", 1); header("Location: $mydomain?page=login&ref=$mydomain?page=$page"); return false; } } //!! Contains domain !! Function DoRedirect($message = "Thanks", $to = "http://www.mazetd.4xg.net/", $duration = "3") { $to=(is_null($to)?'http://www.mazetd.4xg.net/':$to); if ($duration == 0) { header("Location: $to"); } //require "format/header.php"; echo "




$message
You are now being redirected.
Click here if not redirected in $duration seconds.
"; } ?>