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


PHP Utility::ValidEmail方法代碼示例

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


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

示例1: submit_reg

 public function submit_reg()
 {
     $email = htmlspecialchars($this->_param("email"));
     if (!Utility::ValidEmail($email)) {
         Session::Set("error", "郵箱格式有誤");
         redirect("/register");
     }
     // $code = M("InviteCodes")->getByCode($this->_post('invite_code'));
     // if(!$code) {
     //     Session::Set("error", "無效邀請碼");
     //     redirect("/register");
     // }
     $userModel = D("CmsUsers");
     if ($userModel->create()) {
         $userModel->username = $userModel->email;
         $userModel->password = D("CmsUsers")->genPassword($userModel->password);
         $userModel->secret = md5(generate_password());
         $userModel->ip = Utility::GetRemoteIp();
         $userModel->partner_id = intval($this->_param('partner_id'));
         $secret = $userModel->secret;
         $id = $userModel->add();
     } else {
         Session::Set("error", "注冊失敗,請重新嘗試或者聯係網站管理員");
         redirect("/register");
     }
     // 綁定郵箱到邀請碼
     // $code_data['id'] = $code['id'];
     // $code_data['email'] = $this->_param("email");
     // $code_data['bind_time'] = date('Y-m-d H:i:s');
     // M("InviteCodes")->save($code_data);
     //發驗證郵件
     $this->send_verify_mail($id, $email, $secret);
     redirect('/register/preview_verify_email?token=' . Crypt::en($id . '||' . $email));
 }
開發者ID:Germey,項目名稱:yinxingapply,代碼行數:34,代碼來源:RegisterAction.class.php

示例2: mail_zd

function mail_zd($email)
{
    global $option_mail;
    if (!Utility::ValidEmail($email)) {
        return false;
    }
    preg_match('#@(.+)$#', $email, $m);
    $suffix = strtolower($m[1]);
    return $option_mail[$suffix];
}
開發者ID:norain2050,項目名稱:zuituware,代碼行數:10,代碼來源:utility.php

示例3: Create

 public static function Create($email, $city_id)
 {
     if (!Utility::ValidEmail($email, true)) {
         return;
     }
     $secret = md5($email . $city_id);
     $table = new Table('subscribe', array('email' => $email, 'city_id' => $city_id, 'secret' => $secret));
     Table::Delete('subscribe', $email, 'email');
     $table->insert(array('email', 'city_id', 'secret'));
 }
開發者ID:yunsite,項目名稱:hhzuitu,代碼行數:10,代碼來源:ZSubscribe.class.php

示例4: Create

 public static function Create($email, $city_id)
 {
     if (!Utility::ValidEmail($email, true)) {
         return;
     }
     $secret = md5($email . $city_id);
     $table = new Table('subscribe', array('email' => $email, 'city_id' => $city_id, 'secret' => $secret));
     Table::Delete('subscribe', $email, 'email');
     $table->insert(array('email', 'city_id', 'secret'));
     /* notice */
     /*
     $host = $_SERVER['HTTP_HOST'];
     $u = "http://notice.zuitu.com/subscribe.php?email={$email}&city_id={$city_id}&secret={$secret}&host={$host}";
     Utility::HttpRequest($u);
     */
 }
開發者ID:jowino,項目名稱:bd786110cact,代碼行數:16,代碼來源:ZSubscribe.class.php

示例5: dirname

<?php

require_once dirname(dirname(__FILE__)) . '/app.php';
if ($_POST) {
    $u = array();
    $u['username'] = $_POST['username'];
    $u['password'] = $_POST['password'];
    $u['email'] = $_POST['email'];
    if ($_POST['subscribe']) {
        ZSubscribe::Create($_POST['email'], $city['id']);
    }
    if (!Utility::ValidEmail($_POST['email'], true)) {
        Session::Set('error', 'Email is not a valid email address');
        Utility::Redirect(WEB_ROOT . '/account/signup.php');
    }
    if ($_POST['password2'] == $_POST['password'] && $_POST['password']) {
        if ($INI['system']['emailverify']) {
            $u['enable'] = 'N';
        }
        $usergroup = Table::Fetch('user_group', 'customer', 'name');
        if (!empty($usergroup)) {
            $u['user_group_id'] = $usergroup['id'];
        }
        if ($user_id = ZUser::Create($u)) {
            if ($INI['system']['emailverify']) {
                mail_sign_id($user_id);
                Session::Set('unemail', $_POST['email']);
                Utility::Redirect(WEB_ROOT . '/account/verify.php');
            } else {
                ZLogin::Login($user_id);
                Utility::Redirect(WEB_ROOT . '/index.php');
開發者ID:jowino,項目名稱:bd786110cact,代碼行數:31,代碼來源:signup.php

示例6: dirname

<?php

require_once dirname(dirname(__FILE__)) . '/app.php';
if ($_POST) {
    $u = array();
    $u['username'] = strval($_POST['username']);
    $u['password'] = strval($_POST['password']);
    $u['email'] = strval($_POST['email']);
    $u['city_id'] = isset($_POST['city_id']) ? abs(intval($_POST['city_id'])) : abs(intval($city['id']));
    $u['mobile'] = strval($_POST['mobile']);
    if ($_POST['subscribe']) {
        ZSubscribe::Create($u['email'], abs(intval($u['city_id'])));
    }
    if (!Utility::ValidEmail($u['email'], true)) {
        Session::Set('error', 'Email地址為無效地址');
        redirect(WEB_ROOT . '/account/signup.php');
    }
    if ($_POST['password2'] == $_POST['password'] && $_POST['password']) {
        if (option_yes('emailverify')) {
            $u['enable'] = 'N';
        }
        if ($user_id = ZUser::Create($u)) {
            if (option_yes('emailverify')) {
                mail_sign_id($user_id);
                Session::Set('unemail', $_POST['email']);
                redirect(WEB_ROOT . '/account/signuped.php');
            } else {
                ZLogin::Login($user_id);
                redirect(get_loginpage(WEB_ROOT . '/index.php'));
            }
        } else {
開發者ID:hhdem,項目名稱:tuangala_v2,代碼行數:31,代碼來源:signup.php

示例7: need_login

$ms = $ms['data'];
if (!$ms['name']) {
    need_login();
}
$name = $ms['nick'];
$type = "qq";
$sns = "qq:{$ms['name']}";
$exist_user = Table::Fetch('user', $sns, 'sns');
if ($exist_user) {
    Session::Set('user_id', $exist_user['id']);
    Utility::Redirect(get_loginpage(WEB_ROOT . '/index.php'));
}
if ($_POST) {
    if ($_POST['sns_action'] == 'bind') {
        $email = $_POST['email'];
        if (!Utility::ValidEmail($email, true)) {
            Session::Set('error', 'Email地址為無效地址');
            redirect(WEB_ROOT . '/account/qq_bind.php');
        }
        if ($_POST['password'] == "") {
            Session::Set('error', '請輸入正確密碼');
            redirect(WEB_ROOT . '/account/qq_bind.php');
        }
        $encrypt_pass = ZUser::GenPassword($_POST['password']);
        $update = array('sns' => $sns);
        $sns_bind = Table::Fetch('user', $email, 'email');
        if (!$sns_bind) {
            Session::Set('error', '郵箱輸入不正確');
            Utility::Redirect(WEB_ROOT . '/account/qq_bind.php');
        }
        if ($sns_bind['password'] != $encrypt_pass) {
開發者ID:norain2050,項目名稱:zuituware,代碼行數:31,代碼來源:qq_bind.php

示例8: subscribe

 public function subscribe()
 {
     $name = $this->_param("name");
     $email = $this->_param("email");
     if (Utility::ValidEmail($email)) {
         $param = array("name" => $name, "email" => $email, 'create_time' => time());
         M("Subscribers")->add($param);
         return json("subscribe_callback(1, '訂閱成功!')", 'eval');
     }
     return json("subscribe_callback(0, '郵件格式有誤!')", 'eval');
 }
開發者ID:caijinlin,項目名稱:hackathon,代碼行數:11,代碼來源:CommonAction.class.php

示例9: dirname

<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
need_manager();
if ($_POST) {
    $_POST['content'] = stripslashes($_POST['content']);
    $content = $_POST['content'];
    $emails = $_POST['emails'];
    $subject = $_POST['title'];
    $emails = preg_split('/[\\s,]+/', $emails, -1, PREG_SPLIT_NO_EMPTY);
    $emails_array = array();
    foreach ($emails as $one) {
        if (Utility::ValidEmail($one)) {
            $emails_array[] = $one;
        }
    }
    $email_count = count($emails_array);
    $hostprefix = "http://{$_SERVER['HTTP_HOST']}/";
    $content = str_ireplace('href="/', "href=\"{$hostprefix}", $content);
    if (!$email_count) {
        Session::Set('error', '發送郵件錯誤:缺少合法的收件人郵件地址');
    } else {
        try {
            mail_custom($emails_array, $subject, $content);
            Session::Set('notice', "發送郵件成功,數量:{$email_count}");
            Utility::Redirect(WEB_ROOT . '/manage/market/index.php');
        } catch (Exception $e) {
            Session::Set('error', '發送郵件錯誤:' . $e->getMessage());
        }
    }
}
開發者ID:BGCX262,項目名稱:zuitu-svn-to-git,代碼行數:31,代碼來源:index.php

示例10:

if($_POST){
	$insert = $_POST['insert'];
	
	$au = Table::Fetch('user', $insert['mobile'], 'mobile');
	if ( $au ) {
		Session::Set('error', '注冊失敗,手機號碼已被使用');		
		//redirect('register.php');
	}else{
		$mobile_zz = '/^[1][3-8]\\d{9}$/';
		if(!preg_match($mobile_zz,$insert['mobile'])){
			Session::Set('error', '注冊失敗,手機號碼格式不正確');
			//redirect('register.php');
		}
	}
	
	if ( ! Utility::ValidEmail($insert['email'], true) ) {
		Session::Set('error', 'Email地址為無效地址');
		//redirect('register.php');
	}
	
	if($insert['password']){
		//	
		if ( $user_id = ZUser::Create($insert) ) {
			ZCredit::Register($user_id);
			ZLogin::Login($user_id);
			redirect('index.php');
		}
	}
}

開發者ID:noikiy,項目名稱:mdwp,代碼行數:29,代碼來源:register.php


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