当前位置: 首页>>代码示例>>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;未经允许,请勿转载。