本文整理汇总了PHP中email::valida方法的典型用法代码示例。如果您正苦于以下问题:PHP email::valida方法的具体用法?PHP email::valida怎么用?PHP email::valida使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类email
的用法示例。
在下文中一共展示了email::valida方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: email
// forgot_password.php
// All Sections
// Form to retrieve forgot password
//*
//Include global functions
include_once "common.php";
//Initiate database functions
include_once "ez_sql.php";
// config
include_once "configuration.php";
$action = get_param("action");
if ($action == "retrieve") {
$forgotemail = get_param("forgotemail");
//Validate email
$oEmail = new email();
if (!$oEmail->valida($forgotemail)) {
$msgFormErr = _FORGOT_PASSWORD_FORM_ERROR . "<br>";
} else {
if ($retrieve = $db->get_row("SELECT studentcontact_id, studentcontact_lname, studentcontact_fname FROM studentcontact WHERE studentcontact_email='" . $forgotemail . "'")) {
$name = $retrieve->studentcontact_fname . " " . $retrieve->studentcontact_lname;
$id = $retrieve->studentcontact_id;
$lostpassword = $db->get_var("SELECT web_users_password FROM web_users WHERE web_users_type='C' AND web_users_relid='" . $id . "'");
} else {
if ($retrieve = $db->get_row("SELECT teachers_id, teachers_lname, teachers_fname FROM teachers WHERE teachers_email='" . $forgotemail . "'")) {
$name = $retrieve->teachers_fname . " " . $retrieve->teachers_lname;
$id = $retrieve->teachers_id;
$lostpassword = $db->get_var("SELECT web_users_password FROM web_users WHERE web_users_type='T' AND web_users_relid='" . $id . "'");
}
}
}
if (strlen($lostpassword)) {
示例2: email
$msgFormErr .= _ADMIN_ADD_EDIT_TEACHER_2_ENTER_FIRST . "<br>";
}
if (!strlen($tlname)) {
$msgFormErr .= _ADMIN_ADD_EDIT_TEACHER_2_ENTER_LAST . "<br>";
}
if (!strlen($username)) {
$msgFormErr .= _ADMIN_ADD_EDIT_TEACHER_2_ENTER_USER . "<br>";
}
if (!strlen($password)) {
$msgFormErr .= _ADMIN_ADD_EDIT_TEACHER_2_ENTER_PASS . "<br>";
}
if (!strlen($email)) {
$msgFormErr .= _ADMIN_ADD_EDIT_TEACHER_2_ENTER_EMAIL . "<br>";
} else {
$oEmail = new email();
if (!$oEmail->valida($email)) {
$msgFormErr .= _ADMIN_ADD_EDIT_TEACHER_2_EMAIL_VALID . "<br>";
}
}
//Check to make sure duplicate usernames are not being assigned
//check for duplicate username.
$tot = $db->get_var("SELECT COUNT(*) FROM web_users WHERE \nweb_users_username='{$username}' AND web_users_id<>'{$webid}'");
if ($tot > 0) {
$msgFormErr .= _ADMIN_ADD_EDIT_TEACHER_2_DUP;
}
//If a new user, check to make sure we're not adding dupe username.
//If a new user, webid will be empty
if ($webid == "") {
$tot = $db->get_var("SELECT COUNT(*) FROM web_users WHERE \nweb_users_username='{$username}'");
if ($tot > 0) {
$msgFormErr .= _ADMIN_ADD_EDIT_TEACHER_2_DUP;