Example #1
0
<?php

require '..' . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'bootstrap.config.php';
$Email_ID = "hello@gmail.com";
$Token = "This is a Fake Token.";
$User_Name = "Ankit";
//Date the user was added
$Signup_date = Database::date();
$Mobile = 1234567899;
$College = "DTU";
User::add_new_user($Email_ID, $Token, $User_Name, $Signup_date, $Mobile, $College);
Example #2
0
        unset($name);
    }
}
if (empty($login) or empty($password) or empty($email) or empty($name)) {
    exit("You entered no all info!");
}
$login = stripslashes($login);
$login = htmlspecialchars($login);
$name = stripslashes($name);
$name = htmlspecialchars($name);
$email = stripslashes($email);
$email = htmlspecialchars($email);
$password = stripslashes($password);
$password = htmlspecialchars($password);
$login = trim($login);
$email = trim($email);
$name = trim($name);
$password = trim($password);
if (User::check_user_by_login($login)) {
    exit("Login is used somebody.");
} else {
    if (User::check_user_by_email($email)) {
        exit("Email is used somebody.");
    } else {
        User::add_new_user($login, $password, $name, $email);
        $_SESSION['login_user'] = $login;
        $_SESSION['hash_user'] = User::getHash($login);
        header("Location: ../index.php");
        exit;
    }
}