예제 #1
0
<?php

session_start();
include_once '../classes/accountHandler.php';
$accountHandler = new accountHandler();
$email = $_POST['email'];
$password = $_POST['password'];
$results = $accountHandler->authenticate($email, $password);
if ($results) {
    session_regenerate_id();
    $_SESSION['sess_ID'] = $results['UserID'];
    $_SESSION['sess_Level'] = $results['Level'];
    $_SESSION['sess_FirstName'] = ucwords($results['FirstName']);
    session_write_close();
    echo 1;
} else {
    echo 0;
}
<?php

include_once '../classes/accountHandler.php';
$accountHandler = new accountHandler();
$firstName = $_POST['firstName'];
$lastName = $_POST['lastName'];
$email = $_POST['email'];
$password = $_POST['password'];
$success = $accountHandler->createAccount($firstName, $lastName, $email, $password);
if ($success) {
    echo 1;
} else {
    echo 0;
}