Beispiel #1
0
}
if (isset($_POST['submit'])) {
    $data = array('Firstname' => $_POST['fname'], 'Lastname' => $_POST['lname'], 'Gender' => $_POST['gender'], 'Username' => $_POST['username'], 'Password' => $_POST['password'], 'Email' => $_POST['email'], 'Address' => $_POST['address']);
    $pass = true;
    foreach ($data as $var => $value) {
        if (empty($value)) {
            echo $var . " is empty!";
            $pass = false;
            break;
        }
    }
    if ($pass) {
        $db = new DBCOnnection();
        $register->setDB($db->connect());
        if ($register->verification('email', $data['Email']) && $register->verification('username', $data['Username'])) {
            $register->setFirstname($data['Firstname']);
            $register->setLastname($data['Lastname']);
            $register->setGender($data['Gender']);
            $register->setUsername($data['Username']);
            $register->setPassword($data['Password']);
            $register->setEmail($data['Email']);
            $register->setAddress($data['Address']);
            $register->setIsDoctor($_POST['is_doctor']);
            if ($register->insert() != -1) {
                $register->redirect();
            }
        } else {
            echo Register::getMessage();
        }
    }
}
Beispiel #2
0
     }
     $_SESSION["first_login"] = true;
     //There user's first sign in
     $Register = new Register($Database);
     //Initialize the register class
     //Register the user
     try {
         $Register->setFirstName($user["first_name"]);
         //Save the user's first name
         $Register->setLastName($user["last_name"]);
         //Save the user's last name
         $Register->setUniqueUsername($user["username"]);
         //Save the user's username
         $Register->setThumbnail('https://graph.facebook.com/' . $user["username"] . '/picture');
         //Save the user's thumbnail
         $Register->setGender($user["gender"]);
         //Save the user's gender
         $Register->setEmail($fb_email);
         //Save the user's email
         $Register->setRegisterType($_SESSION["login_type"]);
         //The type of registration
         $Register->setUserId($user["id"]);
         //Save the facebook id
         $Register->insertUser();
         //Register the user
     } catch (Exception $e) {
         echo $e->getMessage();
     }
 }
 $_SESSION["in"] = true;
 //The user is logged in