• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP is_valid_email函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中is_valid_email函数的典型用法代码示例。如果您正苦于以下问题:PHP is_valid_email函数的具体用法?PHP is_valid_email怎么用?PHP is_valid_email使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: smarty_function_user_link

/**
 * Display user name with a link to users profile
 * 
 * - user - User - We create link for this User
 * - short - boolean - Use short display name
 * 
 * @param array $params
 * @param Smarty $smarty
 * @return string
 */
function smarty_function_user_link($params, &$smarty)
{
    static $cache = array();
    $user = array_var($params, 'user');
    $short = array_var($params, 'short', false);
    // User instance
    if (instance_of($user, 'User')) {
        if (!isset($cache[$user->getId()])) {
            //BOF:mod 20121030
            /*
            //EOF:mod 20121030
                    $cache[$user->getId()] = '<a href="' . $user->getViewUrl() . '" class="user_link">' . clean($user->getDisplayName($short)) . '</a>';
            //BOF:mod 20121030
            */
            $cache[$user->getId()] = '<a href="' . $user->getViewUrl() . '" class="user_link">' . clean($user->getDisplayName()) . '</a>';
            //EOF:mod 20121030
        }
        // if
        return $cache[$user->getId()];
        // AnonymousUser instance
    } elseif (instance_of($user, 'AnonymousUser') && trim($user->getName()) && is_valid_email($user->getEmail())) {
        return '<a href="mailto:' . $user->getEmail() . '" class="anonymous_user_link">' . clean($user->getName()) . '</a>';
        // Unknown user
    } else {
        return '<span class="unknow_user_link unknown_object_link">' . clean(lang('Unknown user')) . '</span>';
    }
    // if
}
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:38,代码来源:function.user_link.php


示例2: authenticate

 /**
  * Authenticate user
  * 
  * Returns TRUE on success or error message on failure
  *
  * @param string $email
  * @param string $password
  * @return boolean
  */
 function authenticate($email, $password)
 {
     if (empty($email) || trim($password) == '') {
         return 'Email address and password values are required';
     }
     // if
     if (!is_valid_email($email)) {
         return 'Invalid email address format';
     }
     // if
     $user = $this->db->execute_one('SELECT role_id, password FROM ' . TABLE_PREFIX . 'users WHERE email = ?', array($email));
     if (is_array($user)) {
         if (!$this->checkUserPassword($password, $user['password'])) {
             return 'Invalid password';
         }
         // if
     } else {
         return "Invalid email address. User does not exist";
     }
     // if
     if (!$user['role_id']) {
         return 'Authenticated user is not administrator';
     }
     // if
     // Check administration access
     if ($this->isUserAdministrator($user['role_id'])) {
         return true;
     } else {
         return 'Authenticated user is not administrator';
     }
     // if
 }
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:41,代码来源:UpgradeUtility.class.php


示例3: get_email

function get_email($query_result)
{
    $possible_emails = array();
    $valid_emails = array();
    if (!empty($query_result[0]["mail"][0])) {
        $valid_emails[] = $query_result[0]["mail"][0];
    }
    if (is_array($query_result[0]["proxyaddresses"])) {
        foreach ($query_result[0]["proxyaddresses"] as $key => $val) {
            if (is_numeric($key)) {
                $email = strtolower($val);
                if (substr($email, 0, 5) == "smtp:") {
                    $possible_emails[] = substr($email, 5);
                } else {
                    $possible_emails[] = $email;
                }
            }
        }
    }
    foreach ($possible_emails as $key => $val) {
        if (is_valid_email($val) && !in_array($val, $valid_emails)) {
            $valid_emails[] = $val;
        }
    }
    return $valid_emails;
}
开发者ID:brightskylee,项目名称:swe,代码行数:26,代码来源:mu_ldap_helper.php


示例4: smarty_function_mtcommentauthorlink

function smarty_function_mtcommentauthorlink($args, &$ctx)
{
    $mt = MT::get_instance();
    $comment = $ctx->stash('comment');
    $name = $comment->comment_author;
    if (!$name && isset($args['default_name'])) {
        $name = $args['default_name'];
    }
    $name or $name = $mt->translate("Anonymous");
    require_once "MTUtil.php";
    $name = encode_html($name);
    $email = $comment->comment_email;
    $url = $comment->comment_url;
    if (isset($args['show_email'])) {
        $show_email = $args['show_email'];
    } else {
        $show_email = 0;
    }
    if (isset($args['show_url'])) {
        $show_url = $args['show_url'];
    } else {
        $show_url = 1;
    }
    $target = isset($args['new_window']) && $args['new_window'] ? ' target="_blank"' : '';
    _comment_follow($args, $ctx);
    $cmntr = $ctx->stash('commenter');
    if (!isset($cmntr) && isset($comment->comment_commenter_id)) {
        $cmntr = $comment->commenter();
    }
    if ($cmntr) {
        $name = isset($cmntr->author_nickname) ? encode_html($cmntr->author_nickname) : $name;
        if ($cmntr->author_url) {
            return sprintf('<a title="%s" href="%s"%s>%s</a>', encode_html($cmntr->author_url), encode_html($cmntr->author_url), $target, $name);
        }
        return $name;
    } elseif ($show_url && $url) {
        require_once "function.mtcgipath.php";
        $cgi_path = smarty_function_mtcgipath($args, $ctx);
        $comment_script = $ctx->mt->config('CommentScript');
        $name = strip_tags($name);
        $url = encode_html(strip_tags($url));
        if ($comment->comment_id && (!isset($args['no_redirect']) || isset($args['no_redirect']) && !$args['no_redirect']) && (!isset($args['nofollowfy']) || isset($args['nofollowfy']) && !$args['nofollowfy'])) {
            return sprintf('<a title="%s" href="%s%s?__mode=red;id=%d"%s>%s</a>', $url, $cgi_path, $comment_script, $comment->comment_id, $target, $name);
        } else {
            return sprintf('<a title="%s" href="%s"%s>%s</a>', $url, $url, $target, $name);
        }
    } elseif ($show_email && $email && is_valid_email($email)) {
        $email = encode_html(strip_tags($email));
        $str = 'mailto:' . $email;
        if ($args['spam_protect']) {
            $str = spam_protect($str);
        }
        return sprintf('<a href="%s">%s</a>', $str, $name);
    }
    return $name;
}
开发者ID:benvanstaveren,项目名称:movabletype,代码行数:56,代码来源:function.mtcommentauthorlink.php


示例5: test_email

 /**
  * Test Mailer
  *
  * @param void
  * @return null
  */
 function test_email()
 {
     $email_data = $this->request->post('email');
     if (!is_array($email_data)) {
         $email_data = array('recipient' => $this->logged_user->getEmail(), 'subject' => lang('activeCollab - test email'), 'message' => lang("<p>Hi,</p>\n\n<p>Purpose of this message is to test whether activeCollab can send emails or not</p>"));
     }
     // if
     $this->smarty->assign('email_data', $email_data);
     if ($this->request->isSubmitted()) {
         $errors = new ValidationErrors();
         $subject = trim(array_var($email_data, 'subject'));
         $message = trim(array_var($email_data, 'message'));
         $recipient = trim(array_var($email_data, 'recipient'));
         if ($subject == '') {
             $errors->addError(lang('Message subject is required'), 'subject');
         }
         // if
         if ($message == '') {
             $errors->addError(lang('Message body is required'), 'message');
         }
         // if
         if (is_valid_email($recipient)) {
             $recipient_name = null;
             $recipient_email = $recipient;
         } else {
             if (($pos = strpos($recipient, '<')) !== false && str_ends_with($recipient, '>')) {
                 $recipient_name = trim(substr($recipient, 0, $pos));
                 $recipient_email = trim(substr($recipient, $pos + 1, strlen($recipient) - $pos - 2));
                 if (!is_valid_email($recipient_email)) {
                     $errors->addError(lang('Invalid email address'), 'recipient');
                 }
                 // if
             } else {
                 $errors->addError(lang('Invalid recipient'), 'recipient');
             }
             // if
         }
         // if
         if ($errors->hasErrors()) {
             $this->smarty->assign('errors', $errors);
             $this->render();
         }
         // if
         $mailer =& ApplicationMailer::mailer();
         $email_message = new Swift_Message($subject, $message, 'text/html', EMAIL_ENCODING, EMAIL_CHARSET);
         if ($mailer->send($email_message, new Swift_Address($recipient_email, $recipient_name), $this->logged_user->getEmail())) {
             flash_success('Test email has been sent, check your inbox');
         } else {
             flash_error('Failed to send out test email');
         }
         // if
         $this->redirectTo('admin_tools_test_email');
     }
     // if
 }
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:61,代码来源:SystemToolsController.class.php


示例6: send_email

function send_email($email, $subject, $texte, $from = "", $headers = "")
{
    global $hebergeur, $queue_mails, $flag_wordwrap, $os_serveur;
    include_lcm('inc_filters');
    if (!$from) {
        $email_envoi = read_meta("email_sender");
        $from = is_valid_email($email_envoi) ? $email_envoi : $email;
    }
    if (!is_valid_email($email)) {
        return false;
    }
    lcm_debug("mail ({$email}): {$subject}");
    $charset = read_meta('charset');
    $headers = "From: {$from}\n" . "MIME-Version: 1.0\n" . "Content-Type: text/plain; charset={$charset}\n" . "Content-Transfer-Encoding: 8bit\n{$headers}";
    $texte = filtrer_entites($texte);
    $subject = filtrer_entites($subject);
    // fignoler ce qui peut l'etre...
    if ($charset != 'utf-8') {
        $texte = str_replace("&#8217;", "'", $texte);
        $subject = str_replace("&#8217;", "'", $subject);
    }
    // encoder le sujet si possible selon la RFC
    if ($GLOBALS['flag_multibyte'] and @mb_internal_encoding($charset)) {
        $subject = mb_encode_mimeheader($subject, $charset, 'Q');
    }
    if ($flag_wordwrap) {
        $texte = wordwrap($texte);
    }
    if ($os_serveur == 'windows') {
        $texte = preg_replace("/\r*\n/", "\r\n", $texte);
        $headers = preg_replace("/\r*\n/", "\r\n", $headers);
    }
    switch ($hebergeur) {
        case 'lycos':
            $queue_mails[] = array('email' => $email, 'sujet' => $subject, 'texte' => $texte, 'headers' => $headers);
            return true;
        case 'free':
            return false;
        case 'online':
            if (!($ret = @email('webmaster', $email, $subject, $texte))) {
                lcm_log("ERROR mail: (online) returned false");
            }
            return $ret;
        default:
            if (!($ret = @mail($email, $subject, $texte, $headers))) {
                lcm_log("ERROR mail: (default) returned false");
            }
            return $ret;
    }
}
开发者ID:nyimbi,项目名称:legalcase,代码行数:50,代码来源:inc_mail.php


示例7: validate_submission_data

/**
 * Validate the submission data by ensure required data exists and is in the 
 * desired format.
 * 
 * @param $data - data array to validate based on expectations
 * @return bool - whether or not the data validated
 */
function validate_submission_data($data)
{
    // name must not be empty
    if (empty($data['name'])) {
        return false;
    }
    // email must not be empty, nor invalid
    if (empty($data['email']) || !is_valid_email($data['email'])) {
        return false;
    }
    // comment must not be empty
    if (empty($data['comment'])) {
        return false;
    }
    return true;
}
开发者ID:Craftpeak,项目名称:Academy-Understanding-PHP,代码行数:23,代码来源:form-submit.php


示例8: get_user_by_email

 public function get_user_by_email($email, $force_refresh = FALSE, $return_id = FALSE)
 {
     if (!$this->id) {
         return FALSE;
     }
     if (!is_valid_email($email)) {
         return FALSE;
     }
     $uid = FALSE;
     $r = $this->db2->query('SELECT iduser FROM users WHERE email="' . $this->db2->escape($email) . '" LIMIT 1', FALSE);
     if ($o = $this->db2->fetch_object($r)) {
         $uid = intval($o->iduser);
         return $return_id ? $uid : $this->get_user_by_id($uid);
     }
     return FALSE;
 }
开发者ID:waqasraza123,项目名称:social_network_in_php_frenzy,代码行数:16,代码来源:class_network.php


示例9: handle_fatal_error

 /**
  * Handle fatal error
  *
  * @param Error $error
  * @return null
  */
 function handle_fatal_error($error)
 {
     if (DEBUG >= DEBUG_DEVELOPMENT) {
         dump_error($error);
     } else {
         if (instance_of($error, 'RoutingError') || instance_of($error, 'RouteNotDefinedError')) {
             header("HTTP/1.1 404 Not Found");
             print '<h1>Not Found</h1>';
             if (instance_of($error, 'RoutingError')) {
                 print '<p>Page "<em>' . clean($error->getRequestString()) . '</em>" not found.</p>';
             } else {
                 print '<p>Route "<em>' . clean($error->getRouteName()) . '</em>" not mapped.</p>';
             }
             // if
             print '<p><a href="' . assemble_url('homepage') . '">&laquo; Back to homepage</a></p>';
             die;
         }
         // if
         // Send email to administrator
         if (defined('ADMIN_EMAIL') && is_valid_email(ADMIN_EMAIL)) {
             $content = '<p>Hi,</p><p>activeCollab setup at ' . clean(ROOT_URL) . ' experienced fatal error. Info:</p>';
             ob_start();
             dump_error($error, false);
             $content .= ob_get_clean();
             @mail(ADMIN_EMAIL, 'activeCollab Crash Report', $content, "Content-Type: text/html; charset=utf-8");
         }
         // if
         // log...
         if (defined('ENVIRONMENT_PATH') && class_exists('Logger')) {
             $logger =& Logger::instance();
             $logger->logToFile(ENVIRONMENT_PATH . '/logs/' . date('Y-m-d') . '.txt');
         }
         // if
     }
     // if
     $error_message = '<div style="text-align: left; background: white; color: red; padding: 7px 15px; border: 1px solid red; font: 12px Verdana; font-weight: normal;">';
     $error_message .= '<p>Fatal error: activeCollab has failed to executed your request (reason: ' . clean(get_class($error)) . '). Information about this error has been logged and sent to administrator.</p>';
     if (is_valid_url(ROOT_URL)) {
         $error_message .= '<p><a href="' . ROOT_URL . '">&laquo; Back to homepage</a></p>';
     }
     // if
     $error_message .= '</div>';
     print $error_message;
     die;
 }
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:51,代码来源:init.php


示例10: parseText

function parseText($input)
{
    $email = array();
    $invalid_email = array();
    $input = ereg_replace("[^-A-Za-z._0-9@ ]", " ", $input);
    $token = trim(strtok($input, " "));
    while ($token !== "") {
        if (strpos($token, "@") !== false) {
            $token = ereg_replace("[^-A-Za-z._0-9@]", "", $token);
            if (is_valid_email($email) !== true) {
                $email[] = strtolower($token);
            } else {
                $invalid_email[] = strtolower($token);
            }
        }
        $token = trim(strtok(" "));
    }
    $email = array_unique($email);
    $invalid_email = array_unique($invalid_email);
    //  return array("valid_email"=>$email, "invalid_email" => $invalid_email);
    return array("valid_email" => $email);
}
开发者ID:adaptive,项目名称:email-extractor-php,代码行数:22,代码来源:lib.php


示例11: get_user_by_email

 public function get_user_by_email($email, $force_refresh = FALSE, $return_id = FALSE)
 {
     if (!$this->id) {
         return FALSE;
     }
     if (!is_valid_email($email)) {
         return FALSE;
     }
     $cachekey = 'n:' . $this->id . 'usermail:' . strtolower($email);
     $uid = $this->cache->get($cachekey);
     if (FALSE != $uid && TRUE != $force_refresh) {
         return $return_id ? $uid : $this->get_user_by_id($uid);
     }
     $uid = FALSE;
     $r = $this->db->query('SELECT id FROM sk_user WHERE email="' . $this->db->e($email) . '" AND active=1 LIMIT 1', FALSE);
     if ($o = $this->db->fetch_object($r)) {
         $uid = intval($o->id);
         $this->cache->set($cachekey, $uid, $BLOBALS['C']->CACHE_EXPIRE);
         return $return_id ? $uid : $this->get_user_by_id($uid);
     }
     $this->cache->del($cachekey);
     return FALSE;
 }
开发者ID:chaobj001,项目名称:tt,代码行数:23,代码来源:class_network.php


示例12: validate

 public function validate(&$data, $nonce_name)
 {
     global $_wt_options;
     $is_valid = parent::validate($data, $nonce_name);
     if ($is_valid) {
         $is_valid = true;
         if (empty($data["comment_content"])) {
             $is_valid = false;
             $this->add_db_result("comment_content", "required", "Content is missing");
         }
         if (empty($data["comment_author"])) {
             $is_valid = false;
             $this->add_db_result("comment_author", "required", "Author is missing");
         }
         if (!empty($data["comment_event_id"]) && $data["comment_event_id"] == 0) {
             $is_valid = false;
             $this->add_db_result("comment_event_id", "required", "Comment event id is missing");
         }
         if (!empty($data["comment_author_email"]) && !is_valid_email($data["comment_author_email"])) {
             $is_valid = false;
             $this->add_db_result("comment_author_email", "field", "Email in not valid");
         }
         if (isset($data["recaptcha_challenge_field"]) && isset($data["recaptcha_response_field"])) {
             require_once WT_PLUGIN_PATH . 'recaptcha/recaptchalib.php';
             $private_key = (string) $_wt_options->options("captcha_private_key");
             if (!empty($private_key)) {
                 $resp = recaptcha_check_answer($private_key, $_SERVER["REMOTE_ADDR"], $data["recaptcha_challenge_field"], $data["recaptcha_response_field"]);
                 $is_valid = $resp->is_valid;
                 $this->add_db_result("comment_captcha", "field", "The reCAPTCHA wasn't entered correctly. Go back and try it again.");
             }
         }
         if (!$is_valid) {
             $this->db_result("error", null, array("data" => $this->db_response_msg));
         }
     }
     return $is_valid;
 }
开发者ID:Ashleyotero,项目名称:oldest-old,代码行数:37,代码来源:class.comment.php


示例13: author_save_new

function author_save_new()
{
    require_privs('admin.edit');
    extract(doSlash(psa(array('privs', 'name', 'email', 'RealName'))));
    $privs = assert_int($privs);
    $length = function_exists('mb_strlen') ? mb_strlen($name, '8bit') : strlen($name);
    if ($name and $length <= 64 and is_valid_email($email)) {
        $exists = safe_field('name', 'txp_users', "name = '" . $name . "'");
        if ($exists) {
            author_list(array(gTxt('author_already_exists', array('{name}' => $name)), E_ERROR));
            return;
        }
        $password = generate_password(PASSWORD_LENGTH);
        $hash = doSlash(txp_hash_password($password));
        $nonce = doSlash(md5(uniqid(mt_rand(), TRUE)));
        $rs = safe_insert('txp_users', "\n\t\t\t\tprivs    = {$privs},\n\t\t\t\tname     = '{$name}',\n\t\t\t\temail    = '{$email}',\n\t\t\t\tRealName = '{$RealName}',\n\t\t\t\tnonce    = '{$nonce}',\n\t\t\t\tpass     = '{$hash}'\n\t\t\t");
        if ($rs) {
            send_password($RealName, $name, $email, $password);
            author_list(gTxt('password_sent_to') . sp . $email);
            return;
        }
    }
    author_list(array(gTxt('error_adding_new_author'), E_ERROR));
}
开发者ID:balcides,项目名称:Cathartic_server,代码行数:24,代码来源:txp_admin.php


示例14: csvFileToArray

 case 'text/csv':
 case 'text/x-csv':
 case 'application/x-csv':
 case 'application/csv':
 case 'text/comma-separated-values':
 case 'application/octet-stream':
     $_userInfo['csv'] = csvFileToArray($_FILES['cvsfile']['tmp_name'], $_userInfo['delimeter']);
     if (is_array($_userInfo['csv'])) {
         $_userInfo['nonImported'] = array();
         $c = 1;
         $_userInfo['csvTime'] = time();
         foreach ($_userInfo['csv'] as $row) {
             if (!isset($row[1])) {
                 $row[1] = '';
             }
             if (!empty($row[0]) && is_valid_email($row[0])) {
                 $sql = "INSERT INTO " . DB_PREPEND . "phpwcms_address (";
                 $sql .= "address_email, address_name, address_key, address_subscription, address_verified, address_tstamp) VALUES (";
                 $sql .= "'" . aporeplace($row[0]) . "', ";
                 $sql .= "'" . aporeplace($row[1]) . "', ";
                 $sql .= "'" . aporeplace(shortHash($row[0] . time())) . "', ";
                 $sql .= "'" . ($_userInfo['subscribe_all'] ? '' : aporeplace(serialize($_userInfo['subscribe_select']))) . "', ";
                 $sql .= $_userInfo['subscribe_active'] . ", FROM_UNIXTIME(" . $_userInfo['csvTime'] . ") )";
                 $sql = _dbQuery($sql, 'INSERT');
                 if (empty($sql['INSERT_ID'])) {
                     $_userInfo['nonImported'][$c] = $row[0] . '; ' . $row[1] . ' (' . mysql_error() . ')';
                 }
             } else {
                 $_userInfo['nonImported'][$c] = $row[0] . '; ' . $row[1];
             }
             $c++;
开发者ID:EDVLanger,项目名称:phpwcms,代码行数:31,代码来源:subscriberimport.form.inc.php


示例15: shouldEnterFirstMessage

function shouldEnterFirstMessage()
{
    global $captcha;
    $chatimmediatly = verify_param('chatimmediately', "/^\\d{1}\$/", '') == 1;
    if ($chatimmediatly) {
        return false;
    }
    if (!isset($_REQUEST['submitted'])) {
        displayStartChat();
        return true;
    } else {
        $TML = new SmartyClass();
        setupStartChat($TML);
        $_SESSION['webim_uname'] = $visitor_name = getSecureText($_REQUEST['visitorname']);
        $_SESSION['webim_email'] = $email = getSecureText($_REQUEST['email']);
        $_SESSION['webim_phone'] = $phone = getSecureText($_REQUEST['phone']);
        $message = getSecureText($_REQUEST['message']);
        $captcha_num = getSecureText($_REQUEST['captcha']);
        $has_errors = false;
        if (!$captcha->checkNumber($captcha_num)) {
            $TML->assign('errorcaptcha', true);
            $has_errors = true;
        } elseif (empty($visitor_name) && Visitor::getInstance()->canVisitorChangeName()) {
            $TML->assign('errorname', true);
            $has_errors = true;
        } elseif (!is_valid_name($visitor_name) && Visitor::getInstance()->canVisitorChangeName()) {
            $TML->assign('errornameformat', true);
            $has_errors = true;
        } elseif (empty($message)) {
            $TML->assign('errormessage', true);
            $has_errors = true;
        } else {
            if (!is_valid_email($email) && !intval($_SESSION['uid'])) {
                $TML->assign('erroremailformat', true);
                $has_errors = true;
            }
        }
        $captcha->setNumber();
        if ($has_errors) {
            $TML->assign('visitorname', $visitor_name);
            $TML->assign('email', $email);
            $TML->assign('phone', $phone);
            $TML->assign('captcha_num', '');
            $TML->display('start-chat.tpl');
            return true;
        }
        return false;
    }
}
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:49,代码来源:client.php


示例16: author_save_new

function author_save_new()
{
    require_privs('admin.edit');
    extract(doSlash(psa(array('privs', 'name', 'email', 'RealName'))));
    $privs = assert_int($privs);
    if ($name && is_valid_email($email)) {
        $password = doSlash(generate_password(6));
        $nonce = doSlash(md5(uniqid(mt_rand(), TRUE)));
        $rs = safe_insert('txp_users', "\n\t\t\t\tprivs    = {$privs},\n\t\t\t\tname     = '{$name}',\n\t\t\t\temail    = '{$email}',\n\t\t\t\tRealName = '{$RealName}',\n\t\t\t\tnonce    = '{$nonce}',\n\t\t\t\tpass     = password(lower('{$password}'))\n\t\t\t");
        if ($rs) {
            send_password($RealName, $name, $email, $password);
            admin(gTxt('password_sent_to') . sp . $email);
            return;
        }
    }
    admin(gTxt('error_adding_new_author'));
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:17,代码来源:txp_admin.php


示例17: array_map

     $addresses = array_map('trim', $addresses);
     for ($i = 0; $i < count($addresses); ++$i) {
         $octets = explode('.', $addresses[$i]);
         for ($c = 0; $c < count($octets); ++$c) {
             $octets[$c] = strlen($octets[$c]) > 1 ? ltrim($octets[$c], "0") : $octets[$c];
             if ($c > 3 || preg_match('/[^0-9]/', $octets[$c]) || intval($octets[$c]) > 255) {
                 message('You entered an invalid IP/IP-range.');
             }
         }
         $cur_address = implode('.', $octets);
         $addresses[$i] = $cur_address;
     }
     $ban_ip = implode(' ', $addresses);
 }
 require PUN_ROOT . 'include/email.php';
 if ($ban_email != '' && !is_valid_email($ban_email)) {
     if (!preg_match('/^[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,4})$/', $ban_email)) {
         message('The e-mail address (e.g. [email protected]) or partial e-mail address domain (e.g. domain.com) you entered is invalid.');
     }
 }
 if ($ban_expire != '' && $ban_expire != 'Never') {
     $ban_expire = strtotime($ban_expire);
     if ($ban_expire == -1 || $ban_expire <= time()) {
         message('You entered an invalid expire date. The format should be YYYY-MM-DD and the date must be at least one day in the future.');
     }
 } else {
     $ban_expire = 'NULL';
 }
 $ban_user = $ban_user != '' ? '\'' . $db->escape($ban_user) . '\'' : 'NULL';
 $ban_ip = $ban_ip != '' ? '\'' . $db->escape($ban_ip) . '\'' : 'NULL';
 $ban_email = $ban_email != '' ? '\'' . $db->escape($ban_email) . '\'' : 'NULL';
开发者ID:patrickod,项目名称:City-Blogger,代码行数:31,代码来源:admin_bans.php


示例18: SmartyClass

    $email = $aDko[$dept]['email'];
}
$TML = new SmartyClass();
$TML->assignCompanyInfoAndTheme();
$has_errors = false;
if ($mode != 'cons' && empty($email)) {
    $TML->assign('erroremail', true);
    $has_errors = true;
} elseif ($mode != 'cons' && !is_valid_email($email)) {
    $TML->assign('erroremailformat', true);
    $has_errors = true;
}
if ($mode == 'cons' && empty($email_from)) {
    $TML->assign('erroremail_from', true);
    $has_errors = true;
} elseif ($mode == 'cons' && !is_valid_email($email_from)) {
    $TML->assign('erroremailformat_from', true);
    $has_errors = true;
}
if ($has_errors) {
    $TML->assign('threadid', $_REQUEST['threadid']);
    $TML->assign('token', $_REQUEST['token']);
    $TML->assign('level', $_REQUEST['level']);
    if ($mode != 'cons') {
        $TML->display('send-history.tpl');
    } else {
        // отделы службы поддержки free-lance ---
        $aDetps = array();
        foreach ($aDkoOrder as $nOrder) {
            $aDetps[] = array('value' => $nOrder, 'title' => $aDko[$nOrder]['option']);
        }
开发者ID:notUserDeveloper,项目名称:fl-ru-damp,代码行数:31,代码来源:mail.php


示例19: createTxp

function createTxp()
{
    $GLOBALS['textarray'] = setup_load_lang(ps('lang'));
    if (!is_valid_email(ps('email'))) {
        exit(graf(gTxt('email_required')));
    }
    require txpath . '/config.php';
    $ddb = $txpcfg['db'];
    $duser = $txpcfg['user'];
    $dpass = $txpcfg['pass'];
    $dhost = $txpcfg['host'];
    $dprefix = $txpcfg['table_prefix'];
    $dbcharset = $txpcfg['dbcharset'];
    $siteurl = str_replace("http://", '', ps('siteurl'));
    $siteurl = rtrim($siteurl, "/");
    define("PFX", trim($dprefix));
    define('TXP_INSTALL', 1);
    include_once txpath . '/lib/txplib_update.php';
    include txpath . '/setup/txpsql.php';
    // This has to come after txpsql.php, because otherwise we can't call mysql_real_escape_string
    extract(doSlash(psa(array('name', 'pass', 'RealName', 'email'))));
    $nonce = md5(uniqid(rand(), true));
    mysql_query("INSERT INTO `" . PFX . "txp_users` VALUES\n\t\t\t(1,'{$name}',password(lower('{$pass}')),'{$RealName}','{$email}',1,now(),'{$nonce}')");
    mysql_query("update `" . PFX . "txp_prefs` set val = '" . doSlash($siteurl) . "' where `name`='siteurl'");
    mysql_query("update `" . PFX . "txp_prefs` set val = '" . LANG . "' where `name`='language'");
    mysql_query("update `" . PFX . "txp_prefs` set val = '" . getlocale(LANG) . "' where `name`='locale'");
    echo fbCreate();
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:28,代码来源:index.php


示例20: array

                        $cpdata = array('acontent_aid' => $result['INSERT_ID'], 'acontent_uid' => $feedimport_result['cnt_object']['author_id'], 'acontent_created' => date('Y-m-d H:i:s', now()), 'acontent_tstamp' => date('Y-m-d H:i:s', now()), 'acontent_title' => '', 'acontent_subtitle' => '', 'acontent_text' => '', 'acontent_html' => '', 'acontent_sorting' => 100, 'acontent_visible' => 1, 'acontent_before' => '', 'acontent_after' => '', 'acontent_top' => 0, 'acontent_block' => 'CONTENT', 'acontent_anchor' => 0, 'acontent_module' => '', 'acontent_comment' => $article_title, 'acontent_paginate_page' => 0, 'acontent_paginate_title' => '', 'acontent_granted' => 0, 'acontent_tab' => '', 'acontent_image' => '', 'acontent_files' => '', 'acontent_redirect' => '', 'acontent_alink' => '', 'acontent_template' => '', 'acontent_spacer' => '', 'acontent_category' => '', 'acontent_lang' => '', 'acontent_alink' => '', 'acontent_redirect' => '', 'acontent_form' => '', 'acontent_media' => '', 'acontent_newsletter' => '');
                        // CP WYSIWYG HTML
                        if (preg_match('/<[^<]+>/', $article_content) || preg_match('/&[A-Za-z]+|#x[\\dA-Fa-f]+|#\\d+;/', $article_content)) {
                            $cpdata['acontent_type'] = 14;
                            $cpdata['acontent_html'] = $article_content;
                        } else {
                            $cpdata['acontent_type'] = 0;
                            $cpdata['acontent_text'] = $article_content;
                        }
                        // Inset CP Data
                        $insert = _dbInsert('phpwcms_articlecontent', $cpdata);
                        if (!isset($insert['INSERT_ID'])) {
                            dumpVar(mysql_error());
                        }
                    }
                    $feedimport_result['status'][] = date('Y-m-d, H:i:s', $article_begin) . LF . $article_title . LF . $rssvalue->get_permalink() . LF . PHPWCMS_URL . 'phpwcms.php?do=articles&p=2&s=1&id=' . $result['INSERT_ID'];
                    $data = array('cref_type' => 'feed_to_article_import', 'cref_rid' => $result['INSERT_ID'], 'cref_str' => 'feedimport_' . $article_unique_hash);
                    _dbInsert('phpwcms_crossreference', $data);
                    $article_sort_counter = $article_sort_counter + 10;
                }
            }
            // check if status email should be sent
            if (!empty($feedimport_result['cnt_object']['import_status_email']) && is_valid_email($feedimport_result['cnt_object']['import_status_email'])) {
                $feedimport_result['status'] = implode(LF . LF, $feedimport_result['status']);
                sendEmail(array('recipient' => $feedimport_result['cnt_object']['import_status_email'], 'subject' => 'Import Status: ' . $feedimport_result['cnt_name'], 'isHTML' => 0, 'text' => $feedimport_result['status'], 'fromName' => 'Feed Importer'));
            }
        }
    }
    // we quit here
    exit;
}
开发者ID:Ideenkarosell,项目名称:phpwcms,代码行数:31,代码来源:frontend.init.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP is_valid_email_address函数代码示例发布时间:2022-05-15
下一篇:
PHP is_valid函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap