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


PHP email::valida方法代碼示例

本文整理匯總了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)) {
開發者ID:google-code-backups,項目名稱:swifttide,代碼行數:31,代碼來源:forgot_password.php

示例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;
開發者ID:google-code-backups,項目名稱:swifttide,代碼行數:31,代碼來源:admin_add_edit_teacher_2.php


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