Exemple #1
0
$sec = new security();
$login = new user();
$error;
$logincheck = $login->islogin();
if ($logincheck == 1) {
    header("location: modiriat.php");
} else {
    if ($logincheck == 2) {
        header("location: user.php");
    }
}
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    $username = $_POST["username"];
    $password = $_POST["password"];
    $username = $sec->escape($username);
    $username = $sec->deletewhitespace($username);
    $password = $sec->escape($password);
    $password = $sec->deletewhitespace($password);
    $password = md5($password);
    if ($login->athenticate($username, $password) == 1) {
        header("location:modiriat.php");
    } else {
        $error = "نام کاربری یا رمز عبور اشتباه می باشد";
    }
}
?>

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8"/>