當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Dao::saveUser方法代碼示例

本文整理匯總了PHP中Dao::saveUser方法的典型用法代碼示例。如果您正苦於以下問題:PHP Dao::saveUser方法的具體用法?PHP Dao::saveUser怎麽用?PHP Dao::saveUser使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Dao的用法示例。


在下文中一共展示了Dao::saveUser方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: header

// Check if email is empty
if ($phone == '') {
    $SYSTEM_MSG[] = "Phone number cannot be empty.";
    $errflag = true;
}
// Check if password comparator is empty and if it is match with password
if ($cpass == '' || $password != $cpass) {
    $SYSTEM_MSG[] = 'The password you have typed does not match.';
    $errflag = true;
}
// Check if it is a valid E-mail address
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
    $SYSTEM_MSG[] = "{$email} is not a valid E-mail address.";
    $errflag = true;
}
// Check if password is too weak
if (strlen($password) <= 6) {
    $SYSTEM_MSG[] = "Password must be longer than 6 character.";
    $errflag = true;
}
if ($errflag == false) {
    $dao->saveUser($email, $fname, $lname, $phone, $password);
} else {
    $_SESSION['SYSTEM_MSG'] = $SYSTEM_MSG;
    session_write_close();
    header("location: signup.php");
    $errflag = false;
    exit;
}
header("Location:login.php");
//}
開發者ID:antoniodebaca,項目名稱:foreclosure,代碼行數:31,代碼來源:newuser_handler.php

示例2:

        $_SESSION["sign_up_form_errors"] = true;
        $_SESSION["sign_up_email_error"] = "A valid email is required";
        $_SESSION["email"] = $email;
    }
}
if (empty($_POST["password"])) {
    $_SESSION["sign_up_form_errors"] = true;
    $_SESSION["sign_up_password_error"] = "A password is required";
    $_SESSION["email"] = $email;
} else {
    $password = $pass->crypt_pass($_POST['password']);
}
if (!$_SESSION["sign_up_form_errors"]) {
    $user = $dao->getUser($email);
    if (is_null($user["email"])) {
        $dao->saveUser($first, $last, $email, $password);
        $user = $dao->getUser($email);
        $_SESSION["name"] = $first;
        $_SESSION["email"] = $email;
        $_SESSION["user_id"] = $user["id"];
    } else {
        $_SESSION["sign_up_form_errors"] = true;
        $_SESSION["sign_up_email_error"] = "This account already exists";
    }
}
?>
<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="refresh" content="0; url='/'">
開發者ID:nickbender,項目名稱:metacode,代碼行數:31,代碼來源:signup.php


注:本文中的Dao::saveUser方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。