Beispiel #1
0
}
// create the $db object
$db = new Database(DB_SERVER, DB_USER, DB_PASS, DB_DATABASE);
//connect to the server
$db->connect();
//Create Quiz Object
$pq = new Proquiz();
// Mail Class
$mail = new PHPMailer();
// create login object
$auth = new userAuth(TABLE_USERS, true);
if (isset($_POST['action']) || isset($_GET['action'])) {
    //  Login Init With Captcha
    if ($_POST['action'] == 'login') {
        if ($_SESSION['LCNT'] >= 5) {
            if ($auth->checkCaptcha($_POST['captcha_code'])) {
                loginBase($auth, $db);
            } else {
                $_SESSION['ERROR']['type'] = 'Error';
                $_SESSION['ERROR']['reason'] = "Entered Captcha is Incorrect , Please Try Again.";
            }
        } else {
            loginBase($auth, $db);
        }
    }
    // End Login
    //  Start Register Script
    if ($_POST['action'] == 'register') {
        if ($auth->register($db, $_POST)) {
            header('Location:login.php?error=accdone');
        }