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


PHP security::isCorrectEmail方法代碼示例

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


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

示例1: unset

<?php

if (isset($_POST['replacemail1'])) {
    if (!security::isSecureString($_SESSION['username'], 3)) {
        $errors[] = "Username field contains forbidden symbols";
    }
    if (!security::isSecureString($_POST['email'], 2)) {
        $errors[] = "Email field contains forbidden symbols";
    }
    if (!security::isCorrectEmail($_POST['email'])) {
        $errors[] = "Invalid email address";
    }
    if (count($errors) > 0) {
        for ($i = 0; $i < count($errors); $i++) {
            echo $errors[$i] . ".<br/>";
        }
    } else {
        core::$sql->changeDB('acc');
        $user = $_SESSION['username'];
        $email = $_POST['email'];
        if (empty($_SESSION['username']) || empty($_POST['email'])) {
            echo 'Error :';
            echo '<br />';
            echo "You left some fields blank! <a href = '?pg=forgot'>go back and try again!</a>";
            unset($_POST['replacemail1']);
        } else {
            $check = core::$sql->numRows("select Name from TB_User where StrUserID = '{$user}' and Email = '{$email}'");
            if ($check !== 1) {
                echo 'Error :';
                echo '<br />';
                echo "User with following email/password doesn't exist! <a href = '?pg=forgot'>go back and try again!</a>";
開發者ID:EbrahemS,項目名稱:SRCMS,代碼行數:31,代碼來源:emailreplace.php

示例2:

     }
     break;
 case 'myprofile':
     //module disabled
     if ($core->aConfig['allowMyProfile'] == 0) {
         echo "This module is currently disabled.";
         return;
     }
     if (isset($_POST['submit'])) {
         $nGender = (int) $_POST['gender'];
         $szAvatarUrl = null;
         $szSkype = null;
         $szMsn = null;
         $nPublic = (int) $_POST['ispublic'];
         security::isValidUrl($_POST['avatar']) ? $szAvatarUrl = $_POST['avatar'] : ($szAvatarUrl = $core->aConfig[url] . "img/noavatar.png");
         security::isCorrectEmail($_POST['msn']) ? $szMsn = $_POST['msn'] : ($szMsn = "None");
         $szSkype = security::toHTML($_POST['skype']);
         if (strlen($szSkype) > 50) {
             $szSkype = "None";
         }
         if (strlen($szMsn) > 60) {
             $szMsn = "None";
         }
         if (strlen($szAvatarUrl) > 500) {
             $szAvatarUrl = $core->aConfig['url'] . "img/noavatar.png";
         }
         $avatarImageData = @getimagesize($szAvatarUrl);
         //no error if shit happens
         if (empty($avatarImageData[0]) || empty($avatarImageData[1])) {
             $avatarImageData[0] = 0;
             $avatarImageData[1] = 0;
開發者ID:EbrahemS,項目名稱:SRCMS,代碼行數:31,代碼來源:ucp.php


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