当前位置: 首页>>代码示例>>PHP>>正文


PHP Filter::email方法代码示例

本文整理汇总了PHP中Filter::email方法的典型用法代码示例。如果您正苦于以下问题:PHP Filter::email方法的具体用法?PHP Filter::email怎么用?PHP Filter::email使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Filter的用法示例。


在下文中一共展示了Filter::email方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Soup

<?php

require_once "../../global.php";
if (Session::isLoggedIn()) {
    Session::signOut();
}
// get email, if exists
$email = @Filter::email($_GET['email']);
$soup = new Soup();
if (!empty($email)) {
    $soup->set('email', $email);
}
$soup->render('site/page/consent_adult');
开发者ID:malimu,项目名称:Pipeline,代码行数:13,代码来源:consent_adult_c.php

示例2: exit

     exit(json_encode($json));
 }
 // new passwords provided?
 if ($pw != "" || $pw2 != "") {
     // do the passwords match?
     if ($pw != $pw2) {
         $json = array('error' => 'Sorry, your new passwords do not match.');
         exit(json_encode($json));
     }
 }
 // validate email address
 if ($email == "") {
     $json = array('error' => 'You must provide a valid email address.');
     exit(json_encode($json));
 }
 if (!Filter::email($email)) {
     $json = array('error' => 'You must provide a valid email address.');
     exit(json_encode($json));
 }
 // must provide birthdate
 if ($month == "0" || $year == "0") {
     $json = array('error' => 'You must select a valid birth month and year to register.');
     exit(json_encode($json));
 }
 // convert birthdate to MySQL format
 $dob = $year . "-" . $month . "-01";
 // required fields
 $user->setEmail($email);
 if ($pw != "") {
     // convert password to MD5 hash
     $pw = sha1($pw);
开发者ID:malimu,项目名称:Pipeline,代码行数:31,代码来源:user.process.php

示例3: email

 /**
  * Validate emil
  *
  * @param $email
  * @return mixed
  *
  * @deprecated See JBZoo\Utils\Email
  */
 public static function email($email)
 {
     return Filter::email($email);
 }
开发者ID:jbzoo,项目名称:utils,代码行数:12,代码来源:Vars.php

示例4: array

    $body .= '<p>Once you log in, you can change this password to something more memorable by clicking the "Edit" button on your <a href="' . Url::user($user->getID()) . '">profile</a> page.</p>';
    $body .= '<p>Note: If you did not request this password change, please contact the ' . PIPELINE_NAME . ' staff.</p>';
    $newEmail = array('to' => $user->getEmail(), 'subject' => '[' . PIPELINE_NAME . '] Password changed for ' . $user->getUsername(), 'message' => $body);
    Email::send($newEmail);
    // redirect
    Session::setMessage('Your password was reset. Please check your email for the new password.');
    $json = array('success' => '1', 'successUrl' => Url::logIn());
    exit(json_encode($json));
} elseif ($action == 'login') {
    // assign POST vars to local vars after escaping and removing unwanted spacing.
    if (!empty($_POST['username']) && !empty($_POST['password'])) {
        $username = Filter::text($_POST['username']);
        $password = sha1(Filter::text($_POST['password']));
        $referer = Filter::text($_POST['referer']);
        // figure out if user provided username or email address
        if (Filter::email($username)) {
            $user = User::loadByEmail($username);
        } else {
            $user = User::loadByUsername($username);
        }
        if ($user != null) {
            if ($password == $user->getPassword()) {
                // remember user?
                $remember = Filter::text($_POST['remember']);
                $remember = $remember == 'remember' ? true : false;
                // sign in
                Session::signIn($user->getID(), $remember);
                // send us onward
                if (!empty($referer) && $referer != Url::forgotPassword()) {
                    $json = array('success' => '1', 'successUrl' => $referer);
                } else {
开发者ID:malimu,项目名称:Pipeline,代码行数:31,代码来源:login.process.php

示例5: json_encode

<?php

require_once "../../global.php";
$email = Filter::email($_POST['email']);
$name = Filter::text($_POST['name']);
// must provide valid email
if (empty($email)) {
    $json = array('error' => 'You must provide a valid email address.');
    exit(json_encode($json));
}
// save consent
$consent = new Consent(array('email' => $email, 'name' => $name));
$consent->save();
// email confirmation
$body = '<p>You have consented to participate in a Georgia Tech research study looking at how people collaborate online.</p>';
if (!empty($name)) {
    $body .= "<p>Additionally, you have requested that we use your real name if we refer to you in our publications.</p>";
}
$body .= '<p>The consent form is available for viewing and printing at <a href="http://www.scribd.com/doc/66688220/Adult-Web-Consent-Testing?secret_password=4nzp5x09db318hcu9e2">this link</a>. Please retain a copy for your records.</p>';
$body .= '<p>If you have any questions or concerns, please contact the research team at <a href="mailto:' . CONTACT_EMAIL . '">' . CONTACT_EMAIL . '</a>. Thank you for your participation!</p>';
$body .= '<p>-- <a href="http://pipeline.cc.gatech.edu/">The Pipeline team</a> at Georgia Tech</p>';
$newEmail = array('to' => $email, 'subject' => 'Georgia Tech study consent form', 'message' => $body);
Email::send($newEmail);
// send us back
Session::setMessage("Consent form complete! Please register an account.");
$json = array('success' => '1', 'successUrl' => Url::register($email));
echo json_encode($json);
开发者ID:malimu,项目名称:Pipeline,代码行数:27,代码来源:consent.process.php


注:本文中的Filter::email方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。