本文整理汇总了PHP中validation::email方法的典型用法代码示例。如果您正苦于以下问题:PHP validation::email方法的具体用法?PHP validation::email怎么用?PHP validation::email使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类validation
的用法示例。
在下文中一共展示了validation::email方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: substr
}
}
$name = substr($_POST["name"], 0, 30);
$email = substr($_POST["email"], 0, 40);
$password = substr($_POST["password"], 0, 16);
$repassword = substr($_POST["repassword"], 0, 16);
$username = substr($_POST["username"], 0, 30);
$arr = array($name, $email, $password, $repassword, $username);
foreach ($arr as $value) {
if ($value == "") {
die("name cannot be empty");
}
}
$valne = new validation();
$valne->name($name);
$valne->email($email);
$valne->username($username);
$con = new MongoClient();
if ($con) {
$db = $con->{$users};
$people = $db->{$myusers};
$qry = array("email" => $email);
$result = $people->findOne($qry);
if ($result) {
$success = "<div class='alert alert-warning'><strong>Alert !</strong> {$email} already exists </div>";
echo $success;
die;
}
$qry1 = array("username" => $username);
$result1 = $people->findOne($qry1);
if ($result1) {
示例2:
if ($postType == 'register') {
$usernameCheck = $database->requete("SELECT * FROM st_authentication WHERE matricule = '" . $matricule . "'");
if (mysql_num_rows($usernameCheck) != 0) {
$errMessagesArray["matricule"] = "Le matricule existe déjà";
$isSubmissionValid = false;
}
}
}
// Password check
if ($postType == "register" && (empty($password) || strlen($password) < MIN_PASSWORD_LENGTH)) {
// Password must be between x-y characters
$errMessagesArray["password"] = "Le mot de passse doit au moins comporter " . MIN_PASSWORD_LENGTH . " caractères";
$isSubmissionValid = false;
}
// Email check
if (empty($email) || !validation::email($email)) {
$errMessagesArray["email"] = "Vous devez fournir une adresse courriel valide";
$isSubmissionValid = false;
} else {
if (strcmp($email, $emailconf) != 0) {
$errMessagesArray["emailconf"] = "Les deux adresses doivent êtres identiques";
$isSubmissionValid = false;
}
}
// Last name check
if (empty($lastName)) {
$errMessagesArray["lastName"] = "Vous devez fournir une valeur pour ce champ";
$isSubmissionValid = false;
}
// First name check
if (empty($firstName)) {