Esempio n. 1
0
    exit;
}
// verific daca a fost facut submit
if (isset($_POST['login'])) {
    // validez datele
    if (empty($_POST['user']) || empty($_POST['pass'])) {
        // setez un mesaj de eroare
        $error = getError(ERR_INVALID_DATA);
    } else {
        // caut user-ul si verific parola
        if (checkUserPass($_POST['user'], $_POST['pass'], $conn) == null) {
            // setez un mesaj de eroare
            $error = getError(ERR_LOGIN_FAILED);
        } else {
            // daca s-a ajuns aici inseamna ca se poate loga
            markLoggedIn($conn);
        }
    }
}
// verific daca a fost vreo eroare venita de la o alta pagina
if (isset($_GET['error'])) {
    $error = getError($_GET['error']);
}
?>
<!DOCTYPE html>
<html>
<head>
    <link href="../assets/css/login.css" type="text/css" rel="stylesheet">
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
</head>
</head>
Esempio n. 2
0
    exit;
}
// verific daca a fost facut submit
if (isset($_POST['trimite'])) {
    // validez datele
    if (empty($_POST['user'])) {
        // setez un mesaj de eroare
        $error = getError(ERR_INVALID_DATA);
    } else {
        // caut user-ul si verific parola
        if (checkUserPass($_POST['user'], $_POST['pass']) == null) {
            // setez un mesaj de eroare
            $error = getError(ERR_LOGIN_FAILED);
        } else {
            // daca s-a ajuns aici inseamna ca se poate loga
            markLoggedIn();
        }
    }
}
// verific daca a fost vreo eroare venita de la o alta pagina
if (isset($_GET['error'])) {
    $error = getError($_GET['error']);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Războiul Rece</title>
<link href="css/style2.css" rel="stylesheet" type="text/css" />
</head>