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

PHP preg_check函数代码示例

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

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



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

示例1: valid_session

function valid_session($id)
{
    if (preg_check("/^[0-9a-z]+\$/", $id)) {
        return $id;
    } else {
        return "";
    }
}
开发者ID:MichaelFichtner,项目名称:RadioLaFamilia,代码行数:8,代码来源:session_include.php


示例2: verifyCode

 public function verifyCode($value)
 {
     global $locale, $userdata;
     if (!preg_check("/^[0-9a-z]{32}\$/i", $value)) {
         redirect("index.php");
     }
     $result = dbquery("SELECT * FROM " . DB_EMAIL_VERIFY . " WHERE user_code='" . $value . "'");
     if (dbrows($result)) {
         $data = dbarray($result);
         if ($data['user_id'] == $userdata['user_id']) {
             if ($data['user_email'] != $userdata['user_email']) {
                 $result = dbquery("SELECT user_email FROM " . DB_USERS . " WHERE user_email='" . $data['user_email'] . "'");
                 if (dbrows($result) > 0) {
                     addNotice("danger", $locale['u164'] . "<br />\n" . $locale['u121']);
                 } else {
                     $this->_completeMessage = $locale['u169'];
                 }
                 $result = dbquery("UPDATE " . DB_USERS . " SET user_email='" . $data['user_email'] . "' WHERE user_id='" . $data['user_id'] . "'");
                 $result = dbquery("DELETE FROM " . DB_EMAIL_VERIFY . " WHERE user_id='" . $data['user_id'] . "'");
             }
         } else {
             redirect("index.php");
         }
     } else {
         redirect("index.php");
     }
 }
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:27,代码来源:UserFieldsInput.php


示例3: redirect

+--------------------------------------------------------*/
require_once "maincore.php";
require_once THEMES . "templates/header.php";
include LOCALE . LOCALESET . "user_fields.php";
require_once THEMES . "templates/global/register.php";
include THEMES . "templates/global/profile.php";
$_GET['profiles'] = 1;
if (iMEMBER or $settings['enable_registration'] == 0) {
    redirect("index.php");
}
$errors = array();
if (isset($_GET['email']) && isset($_GET['code'])) {
    if (!preg_check("/^[-0-9A-Z_\\.]{1,50}@([-0-9A-Z_\\.]+\\.){1,50}([0-9A-Z]){2,4}\$/i", $_GET['email'])) {
        redirect("register.php?error=activate");
    }
    if (!preg_check("/^[0-9a-z]{40}\$/", $_GET['code'])) {
        redirect("register.php?error=activate");
    }
    $result = dbquery("SELECT user_info FROM " . DB_NEW_USERS . " WHERE user_code='" . $_GET['code'] . "' AND user_email='" . $_GET['email'] . "'");
    if (dbrows($result) > 0) {
        add_to_title($locale['global_200'] . $locale['u155']);
        $data = dbarray($result);
        $user_info = unserialize(base64_decode($data['user_info']));
        dbquery_insert(DB_USERS, $user_info, 'save');
        $result = dbquery("DELETE FROM " . DB_NEW_USERS . " WHERE user_code='" . $_GET['code'] . "' LIMIT 1");
        if (fusion_get_settings('admin_activation') == 1) {
            addNotice("success", $locale['u171'] . " - " . $locale['u162'], 'all');
        } else {
            addNotice("success", $locale['u171'] . " - " . $locale['u161'], 'all');
        }
        redirect(fusion_get_settings('opening_page'));
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:31,代码来源:register.php


示例4: _setUserEmail

 private function _setUserEmail()
 {
     global $locale, $settings;
     $this->_userEmail = isset($_POST['user_email']) ? stripinput(trim(preg_replace("/ +/i", " ", $_POST['user_email']))) : "";
     if ($this->_userEmail != "" && $this->_userEmail != $this->userData['user_email']) {
         // Require user password for email change
         if ($this->_isValidCurrentPassword) {
             // Require a valid email account
             if (preg_check("/^[-0-9A-Z_\\.]{1,50}@([-0-9A-Z_\\.]+\\.){1,50}([0-9A-Z]){2,4}\$/i", $this->_userEmail)) {
                 $email_domain = substr(strrchr($this->_userEmail, "@"), 1);
                 if (dbcount("(blacklist_id)", DB_BLACKLIST, "blacklist_email='" . $this->_userEmail . "' OR blacklist_email='" . $email_domain . "'") != 0) {
                     $this->_setError("user_email", $locale['u124']);
                 } else {
                     $email_active = dbcount("(user_id)", DB_USERS, "user_email='" . $this->_userEmail . "'");
                     $email_inactive = dbcount("(user_code)", DB_NEW_USERS, "user_email='" . $this->_userEmail . "'");
                     if ($email_active == 0 && $email_inactive == 0) {
                         if ($this->verifyNewEmail && $settings['email_verification'] == "1") {
                             $this->_verifyNewEmail();
                         } else {
                             $this->_userLogFields[] = "user_email";
                             $this->_setDBValue("user_email", $this->_userEmail);
                         }
                     } else {
                         $this->_setError("user_email", $locale['u125']);
                     }
                 }
             } else {
                 $this->_setError("user_email", $locale['u123']);
             }
         } else {
             $this->_setError("user_email", $locale['u156']);
         }
     } else {
         $this->_setError("user_email", $locale['u126'], true);
     }
 }
开发者ID:caveman4572,项目名称:PHP-Fusion,代码行数:36,代码来源:UserFieldsInput.class.php


示例5: validate_email

 private function validate_email($value, $default, $name, $id, $required = FALSE, $safemode = FALSE, $error_text = FALSE)
 {
     $value = stripinput(trim(preg_replace("/ +/i", " ", $value)));
     if (preg_check("/^[-0-9A-Z_\\.]{1,50}@([-0-9A-Z_\\.]+\\.){1,50}([0-9A-Z]){2,4}\$/i", $value)) {
         return $value;
     } else {
         $this->stop();
         $this->addError($id);
         $this->addHelperText($id, $error_text);
         $this->addNotice("<b>{$name}</b> is not a valid email address.");
     }
 }
开发者ID:WuChEn,项目名称:PHP-Fusion,代码行数:12,代码来源:defender.inc.php


示例6: verify_email

 /**
  * Checks if is a valid email address
  * accepts only 50 characters + @ + 4 characters
  * returns str the input or bool FALSE if check fails
  */
 protected function verify_email()
 {
     if ($this->field_config['required'] && !$this->field_value) {
         self::setInputError($this->field_name);
     }
     if (preg_check("/^[-0-9A-Z_\\.]{1,50}@([-0-9A-Z_\\.]+\\.){1,50}([0-9A-Z]){2,4}\$/i", $this->field_value)) {
         return $this->field_value;
     }
     return FALSE;
 }
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:15,代码来源:defender.inc.php


示例7: author

| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "maincore.php";
require_once THEMES . "templates/header.php";
require_once INCLUDES . "suspend_include.php";
include LOCALE . LOCALESET . "reactivate.php";
if (iMEMBER) {
    redirect("index.php");
}
if (isset($_GET['user_id']) && isnum($_GET['user_id']) && isset($_GET['code']) && preg_check("/^[0-9a-z]{32}\$/", $_GET['code'])) {
    $result = dbquery("SELECT user_name, user_email, user_actiontime, user_password FROM " . DB_USERS . " WHERE user_id='" . $_GET['user_id'] . "' AND user_actiontime>'0' AND user_status='7'");
    if (dbrows($result)) {
        $data = dbarray($result);
        $code = md5($data['user_actiontime'] . $data['user_password']);
        if ($_GET['code'] == $code) {
            if ($data['user_actiontime'] > time()) {
                $result = dbquery("UPDATE " . DB_USERS . " SET user_status='0', user_actiontime='0', user_lastvisit='" . time() . "' WHERE user_id='" . $_GET['user_id'] . "'");
                unsuspend_log($_GET['user_id'], 7, $locale['506'], true);
                $message = str_replace("[USER_NAME]", $data['user_name'], $locale['505']);
                require_once INCLUDES . "sendmail_include.php";
                sendemail($data['user_name'], $data['user_email'], $settings['siteusername'], $settings['siteemail'], $locale['504'], $message);
                redirect(BASEDIR . "login.php");
            } else {
                redirect(FUSION_SELF . "?error=1");
            }
开发者ID:caveman4572,项目名称:PHP-Fusion,代码行数:31,代码来源:reactivate.php


示例8: author

| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "maincore.php";
require_once THEMES . "templates/header.php";
include LOCALE . LOCALESET . "members.php";
add_to_title($locale['global_200'] . $locale['400']);
opentable($locale['400']);
if (iMEMBER) {
    if (!isset($_GET['sortby']) || !ctype_alnum($_GET['sortby'])) {
        $_GET['sortby'] = "all";
    }
    $orderby = $_GET['sortby'] == "all" ? "" : " AND user_name LIKE '" . stripinput($_GET['sortby']) . "%'";
    $search_text = isset($_GET['search_text']) && preg_check("/^[-0-9A-Z_@\\s]+\$/i", $_GET['search_text']) ? $orderby = ' AND user_name LIKE "' . stripinput($_GET['search_text']) . '%"' : $_GET['sortby'];
    $result = dbquery("SELECT user_id FROM " . DB_USERS . " WHERE user_status='0'" . $orderby);
    $rows = dbrows($result);
    if (!isset($_GET['rowstart']) || !isnum($_GET['rowstart'])) {
        $_GET['rowstart'] = 0;
    }
    if ($rows) {
        $i = 0;
        echo "<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>\n";
        echo "<td class='tbl2'><strong>" . $locale['401'] . "</strong></td>\n";
        echo "<td class='tbl2'><strong>" . $locale['405'] . "</strong></td>\n";
        echo "<td align='center' width='1%' class='tbl2' style='white-space:nowrap'><strong>" . $locale['402'] . "</strong></td>\n";
        echo "</tr>\n";
        $result = dbquery("SELECT user_id, user_name, user_status, user_level, user_groups FROM " . DB_USERS . " WHERE user_status='0'" . $orderby . " ORDER BY user_level DESC, user_name LIMIT " . $_GET['rowstart'] . ",20");
        while ($data = dbarray($result)) {
            $cell_color = $i % 2 == 0 ? "tbl1" : "tbl2";
开发者ID:caveman4572,项目名称:PHP-Fusion,代码行数:31,代码来源:members.php


示例9: author

+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "../maincore.php";
require_once THEMES . "templates/admin_header.php";
include LOCALE . LOCALESET . "admin/comments.php";
if (!checkrights("C") || !defined("iAUTH") || $_GET['aid'] != iAUTH) {
    redirect("../index.php");
}
if (!isset($_GET['ctype']) || !preg_check("/^[0-9A-Z]+\$/i", $_GET['ctype'])) {
    redirect("../index.php");
}
if (!isset($_GET['cid']) || !isnum($_GET['cid'])) {
    redirect("../index.php");
}
if (isset($_GET['status']) && !isset($message)) {
    if ($_GET['status'] == "su") {
        $message = $locale['410'];
    } elseif ($_GET['status'] == "del") {
        $message = $locale['411'];
    }
    if ($message) {
        echo "<div class='admin-message'>" . $message . "</div>\n";
    }
}
开发者ID:simplyianm,项目名称:clububer,代码行数:31,代码来源:comments.php


示例10: isnum

            if (!preg_match("/^[0-9A-Z@]{6,20}\$/i", $user_new_admin_password)) {
                $error .= $locale['440'] . "<br />\n";
            }
            if (encrypt_pw($user_new_admin_password) == encrypt_pw($user_new_password) || encrypt_pw($user_new_admin_password) == $user_data['user_password']) {
                $error .= $locale['439'] . "<br><br>\n";
            }
        }
    }
}
$user_hide_email = isnum($_POST['user_hide_email']) ? $_POST['user_hide_email'] : "1";
if (!$error && !$user_data['user_avatar'] && !empty($_FILES['user_avatar']['name']) && is_uploaded_file($_FILES['user_avatar']['tmp_name'])) {
    require_once INCLUDES . "photo_functions_include.php";
    $file_types = array(".gif", ".jpg", ".jpeg", ".png");
    $avatar_name = str_replace(" ", "_", strtolower(substr($_FILES['user_avatar']['name'], 0, strrpos($_FILES['user_avatar']['name'], "."))));
    $avatar_ext = strtolower(strrchr($_FILES['user_avatar']['name'], "."));
    if (!preg_check("/^[-0-9A-Z_\\[\\]]+\$/i", $avatar_name)) {
        $error .= "Avatar file name is invalid.<br />\n";
    } elseif ($_FILES['user_avatar']['size'] > $settings['avatar_filesize']) {
        $error .= "Avatar file size is too big.<br />\n";
    } elseif (!in_array($avatar_ext, $file_types)) {
        $error .= "Avatar file type is invalid.<br />\n";
    } else {
        $avatar_temp = image_exists(IMAGES . "avatars/", "temp" . $avatar_ext);
        move_uploaded_file($_FILES['user_avatar']['tmp_name'], IMAGES . "avatars/" . $avatar_temp);
        chmod(IMAGES . "avatars/" . $avatar_temp, 0644);
        if (!verify_image(IMAGES . "avatars/" . $avatar_temp)) {
            @unlink(IMAGES . "avatars/" . $avatar_temp);
            $set_avatar = "";
        } else {
            $imagefile = getimagesize(IMAGES . "avatars/" . $avatar_temp);
            $avatar_file = image_exists(IMAGES . "avatars/", $avatar_name . $avatar_ext);
开发者ID:MichaelFichtner,项目名称:RadioLaFamilia,代码行数:31,代码来源:update_profile_include.php


示例11: author

| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "maincore.php";
require_once THEMES . "templates/header.php";
include_once INCLUDES . "bbcode_include.php";
include LOCALE . LOCALESET . "submit.php";
if (!iMEMBER) {
    redirect("index.php");
}
if (!isset($_GET['stype']) || !preg_check("/^[a-z]\$/", $_GET['stype'])) {
    redirect("index.php");
}
$submit_info = array();
if ($_GET['stype'] == "l") {
    if (isset($_POST['submit_link'])) {
        if ($_POST['link_name'] != "" && $_POST['link_url'] != "" && $_POST['link_description'] != "") {
            $submit_info['link_category'] = stripinput($_POST['link_category']);
            $submit_info['link_name'] = stripinput($_POST['link_name']);
            $submit_info['link_url'] = stripinput($_POST['link_url']);
            $submit_info['link_description'] = stripinput($_POST['link_description']);
            $result = dbquery("INSERT INTO " . DB_SUBMISSIONS . " (submit_type, submit_user, submit_datestamp, submit_criteria) VALUES ('l', '" . $userdata['user_id'] . "', '" . time() . "', '" . addslashes(serialize($submit_info)) . "')");
            add_to_title($locale['global_200'] . $locale['400']);
            opentable($locale['400']);
            echo "<div style='text-align:center'><br />\n" . $locale['410'] . "<br /><br />\n";
            echo "<a href='submit.php?stype=l'>" . $locale['411'] . "</a><br /><br />\n";
开发者ID:WuChEn,项目名称:PHP-Fusion,代码行数:31,代码来源:submit.php


示例12: dbarray

    $alias_uid = $userdata['user_id'];
} else {
    $alias_uid = $GLOBALS['user_id'];
}
$alias_foo1 = dbarray(dbquery('SELECT user_aliases FROM ' . DB_PREFIX . 'users WHERE user_id = ' . $alias_uid));
$user_data['user_aliases'] = alias1($alias_foo1['user_aliases']);
unset($alias_foo1);
if ($profile_method == "input") {
    echo "<tr>\n";
    echo "<td valign='top' class='tbl'>Vælg 3 aliaser - Det er tilladt at lade standart-værdien stå</td>\n";
    echo "<td class='tbl'>1: <input type='text' name='user_alias0' value='" . (isset($user_data['user_aliases']) ? $user_data['user_aliases'][0] : '') . "' /><br />2: <input type='text' name='user_alias1' value='" . (isset($user_data['user_aliases']) ? $user_data['user_aliases'][1] : '') . "' /><br />3: <input type='text' name='user_alias2' value='" . (isset($user_data['user_aliases']) ? $user_data['user_aliases'][2] : '') . "' /></td>\n";
    echo "</tr>\n";
} elseif ($profile_method == "display") {
    //Empty
} elseif ($profile_method == "validate_insert") {
    //Empty
} elseif ($profile_method == "validate_update") {
    global $user_data;
    if (!isset($_POST['user_alias0'], $_POST['user_alias1'], $_POST['user_alias2'])) {
        $this->_setError("user_aliases", 'Et eller flere af aliaserne er tomme!');
    } elseif (preg_check("/^[-0-9A-Z_@\\sæøåÆØÅ]{3,30}\$/i", $_POST['user_alias0']) && preg_check("/^[-0-9A-Z_@\\sæøåÆØÅ]{3,30}\$/i", $_POST['user_alias1']) && preg_check("/^[-0-9A-Z_@\\sæøåÆØÅ]{3,30}\$/i", $_POST['user_alias2']) && $_POST['user_alias0'] !== $_POST['user_alias1'] && $_POST['user_alias1'] !== $_POST['user_alias2'] && $_POST['user_alias2'] !== $_POST['user_alias0']) {
        $ualias1_result = dbquery('SELECT user_aliases, user_id FROM ' . DB_PREFIX . 'users WHERE user_aliases REGEXP "^.*,(' . $_POST['user_alias0'] . '|' . $_POST['user_alias1'] . '|' . $_POST['user_alias2'] . '),.*$" AND user_id != ' . $alias_uid);
        if (dbrows($ualias1_result) > 0) {
            $this->_setError("user_aliases", 'Et eller flere af aliaserne er optagede!');
        } else {
            $db_values .= ', user_aliases=",' . $_POST['user_alias0'] . ',' . $_POST['user_alias1'] . ',' . $_POST['user_alias2'] . ',"';
        }
    } else {
        $this->_setError("user_aliases", 'Et eller flere af aliaserne er ugyldige!');
    }
}
开发者ID:necrophcodr,项目名称:Muks,代码行数:31,代码来源:user_aliases_include.php


示例13: setInbox

 private function setInbox()
 {
     global $locale, $userdata;
     /**
      * Sanitize environment
      */
     $myStatus = self::get_pm_settings($userdata['user_id']);
     //print_p($myStatus);
     if (!isset($_GET['folder']) || !preg_check("/^(inbox|outbox|archive|options)\$/", $_GET['folder'])) {
         $_GET['folder'] = "inbox";
     }
     function validate_user($user_id)
     {
         if (isnum($user_id) && dbcount("(user_id)", DB_USERS, "user_id='" . intval($user_id) . "' AND user_status ='0'")) {
             return TRUE;
         }
         return FALSE;
     }
     if (isset($_POST['msg_send']) && isnum($_POST['msg_send']) && validate_user($_POST['msg_send'])) {
         $_GET['msg_send'] = $_POST['msg_send'];
     }
     // prohibits send message to non-existing group
     $user_group = fusion_get_groups();
     unset($user_group[0]);
     if (isset($_POST['msg_to_group']) && isnum($_POST['msg_to_group']) && isset($user_group[$_POST['msg_to_group']])) {
         $_GET['msg_to_group'] = $_POST['msg_to_group'];
     }
     $this->info = array("folders" => array("inbox" => array("link" => BASEDIR . "messages.php?folder=inbox", "title" => $locale['402']), "outbox" => array("link" => BASEDIR . "messages.php?folder=outbox", "title" => $locale['403']), "archive" => array("link" => BASEDIR . "messages.php?folder=archive", "title" => $locale['404']), "options" => array("link" => BASEDIR . "messages.php?folder=options", "title" => $locale['425'])), "inbox_total" => dbrows(dbquery("SELECT message_id FROM " . DB_MESSAGES . " WHERE message_user='" . $userdata['user_id'] . "' and message_to='" . $userdata['user_id'] . "' AND message_folder='0'")), "outbox_total" => dbrows(dbquery("SELECT message_id FROM " . DB_MESSAGES . " WHERE message_user='" . $userdata['user_id'] . "' and message_to='" . $userdata['user_id'] . "' AND message_folder='1'")), "archive_total" => dbrows(dbquery("SELECT message_id FROM " . DB_MESSAGES . " WHERE message_user='" . $userdata['user_id'] . "' and message_to='" . $userdata['user_id'] . "' AND message_folder='2'")), "button" => array("new" => array('link' => BASEDIR . "messages.php?msg_send=new", 'name' => $locale['401']), "options" => array('link' => BASEDIR . "messages.php?folder=options", 'name' => $locale['425'])), "actions_form" => "");
     add_to_title($locale['global_200'] . $locale['400']);
     add_to_meta("description", $locale['400']);
 }
开发者ID:knapnet,项目名称:PHP-Fusion,代码行数:31,代码来源:PrivateMessages.php


示例14: elseif

        $page_content .= "<strong>" . $locale['global_411'] . "</strong><br /><br />\n";
        $page_refresh = "10";
    } elseif (isset($_GET['error']) && $_GET['error'] == 6) {
        // anonymized/deleted
        $page_content .= "<strong>" . $locale['global_412'] . "</strong><br /><br />\n";
        $page_refresh = "10";
    } elseif (isset($_GET['error']) && $_GET['error'] == 8) {
        // username/password does not match
        $page_content .= "<strong>" . $locale['global_196'] . "</strong><br /><br />\n";
    } else {
        if ($settings['login_method'] == "cookies" && isset($_COOKIE[COOKIE_PREFIX . 'user']) || $settings['login_method'] == "sessions" && isset($_SESSION[COOKIE_PREFIX . 'user_id']) && isset($_SESSION[COOKIE_PREFIX . 'user_pass'])) {
            if ($settings['login_method'] == "cookies") {
                $cookie_vars = explode(".", $_COOKIE[COOKIE_PREFIX . 'user']);
                $user_pass = preg_check("/^[0-9a-z]{32}\$/", $cookie_vars['1']) ? $cookie_vars['1'] : "";
            } elseif ($settings['login_method'] == "sessions") {
                $user_pass = preg_check("/^[0-9a-z]{32}\$/", $_SESSION[COOKIE_PREFIX . 'user_pass']) ? $_SESSION[COOKIE_PREFIX . 'user_pass'] : "";
            }
            $user_name = preg_replace(array("/\\=/", "/\\#/", "/\\sOR\\s/"), "", stripinput($_GET['user']));
            if (!dbcount("(user_id)", DB_USERS, "user_name='" . $user_name . "' AND user_password='" . encrypt_pw_part2($user_pass) . "'")) {
                $page_content .= "<strong>" . $locale['global_196'] . "</strong><br /><br />\n";
            } else {
                $result = dbquery("DELETE FROM " . DB_ONLINE . " WHERE online_user='0' AND online_ip='" . USER_IP . "'");
                $page_content .= "<strong>" . $locale['global_193'] . $_GET['user'] . "</strong><br /><br />\n";
            }
        }
    }
}
echo "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>\n";
echo "<html>\n<head>\n";
echo "<title>" . $settings['sitename'] . "</title>\n";
echo "<meta http-equiv='Content-Type' content='text/html; charset=" . $locale['charset'] . "' />\n";
开发者ID:MichaelFichtner,项目名称:RadioLaFamilia,代码行数:31,代码来源:setuser.php


示例15: dbquery

        }
    } else {
        $result = dbquery("SELECT user_id FROM " . DB_USERS . " WHERE user_name='" . $user_name . "' LIMIT 1");
        // Pimped ->
        if (dbrows($result)) {
            $data = dbarray($result);
            dbquery("INSERT INTO " . DB_FAILED_LOGINS . " (user_id, datestamp, logged_ip) VALUES ('" . $data['user_id'] . "', '" . time() . "', '" . USER_IP . "')");
        }
        // Pimped <-
        redirect(BASEDIR . "setuser.php?error=8");
    }
}
if (isset($_COOKIE[COOKIE_PREFIX . 'user'])) {
    $cookie_vars = explode(".", $_COOKIE[COOKIE_PREFIX . 'user']);
    $cookie_1 = isnum($cookie_vars['0']) ? $cookie_vars['0'] : "0";
    $cookie_2 = preg_check("/^[0-9a-z]{32}\$/", $cookie_vars['1']) ? $cookie_vars['1'] : "";
    $result = dbquery("SELECT * FROM " . DB_USERS . " WHERE user_id='" . $cookie_1 . "' AND user_password='" . encrypt_pw_part2($cookie_2) . "' LIMIT 1");
    unset($cookie_vars, $cookie_2);
    // Pimped
    if (dbrows($result)) {
        $userdata = dbarray($result);
        if ($userdata['user_status'] == 0) {
            if ($userdata['user_theme'] != "Default" && file_exists(THEMES . $userdata['user_theme'] . "/theme.php") && ($settings['userthemes'] == 1 || $userdata['user_level'] >= nADMIN)) {
                if (!theme_exists($userdata['user_theme'])) {
                    echo "<strong>" . $settings['sitename'] . " - " . $locale['global_300'] . ".</strong><br /><br />\n";
                    echo $locale['global_301'];
                    die;
                }
            } else {
                if (!theme_exists($settings['theme'])) {
                    echo "<strong>" . $settings['sitename'] . " - " . $locale['global_300'] . ".</strong><br /><br />\n";
开发者ID:MichaelFichtner,项目名称:RadioLaFamilia,代码行数:31,代码来源:cookie_include.php


示例16: validate

 /**
  * Validate the code to the user code
  * @access private
  */
 function validate()
 {
     if (preg_check("/^[0-9a-z]+\$/", strtolower(trim($this->code_entered)))) {
         $result = dbquery("SELECT * FROM " . DB_CAPTCHA . " WHERE captcha_ip='" . USER_IP . "' AND captcha_string='" . strtolower(trim($this->code_entered)) . "'");
         if (dbrows($result)) {
             $result = dbquery("DELETE FROM " . DB_CAPTCHA . " WHERE captcha_ip='" . USER_IP . "' AND captcha_string='" . strtolower(trim($this->code_entered)) . "'");
             $this->correct_code = TRUE;
         } else {
             $this->correct_code = FALSE;
         }
     } else {
         $this->correct_code = FALSE;
     }
 }
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:18,代码来源:securimage.php


示例17: dbquery

    $user_new_admin_password = "";
}
if ($user_name == "" || $user_email == "") {
    $error .= $locale['430'] . "<br />\n";
} else {
    if (preg_check("/^[-0-9A-Z_@\\s]+\$/i", $user_name)) {
        if ($user_name != $userdata['user_name']) {
            $result = dbquery("SELECT user_name FROM " . DB_USERS . " WHERE user_name='" . $user_name . "' AND user_id<>'" . $userdata['user_id'] . "'");
            if (dbrows($result)) {
                $error .= $locale['432'] . "<br />\n";
            }
        }
    } else {
        $error .= $locale['431'] . "<br />\n";
    }
    if (preg_check("/^[-0-9A-Z_\\.]{1,50}@([-0-9A-Z_\\.]+\\.){1,50}([0-9A-Z]){2,4}\$/i", $user_email)) {
        if ($user_email != $userdata['user_email']) {
            if (isset($_POST['user_password']) && md5(md5($_POST['user_password'])) == $userdata['user_password']) {
                $result = dbquery("SELECT user_email FROM " . DB_USERS . " WHERE user_email='" . $user_email . "'");
                if (dbrows($result)) {
                    $error .= $locale['434'] . "<br />\n";
                }
            } else {
                $error .= $locale['437'] . "<br />\n";
            }
        }
    } else {
        $error .= $locale['433'] . "<br />\n";
    }
}
if ($user_new_password) {
开发者ID:simplyianm,项目名称:clububer,代码行数:31,代码来源:update_pass.php


示例18: author

| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "maincore.php";
require_once THEMES . "templates/header.php";
include LOCALE . LOCALESET . "messages.php";
if (!iMEMBER) {
    redirect("index.php");
}
add_to_title($locale['global_200'] . $locale['400']);
$msg_settings = dbarray(dbquery("SELECT * FROM " . DB_MESSAGES_OPTIONS . " WHERE user_id='0'"));
if (iADMIN || $userdata['user_id'] == 1) {
    $msg_settings['pm_inbox'] = 0;
    $msg_settings['pm_savebox'] = 0;
    $msg_settings['pm_sentbox'] = 0;
}
if (!isset($_GET['folder']) || !preg_check("/^(inbox|outbox|archive|options)\$/", $_GET['folder'])) {
    $_GET['folder'] = "inbox";
}
if (isset($_POST['msg_send']) && isnum($_POST['msg_send'])) {
    $_GET['msg_send'] = $_POST['msg_send'];
}
if (isset($_POST['msg_to_group']) && isnum($_POST['msg_to_group'])) {
    $_GET['msg_to_group'] = $_POST['msg_to_group'];
}
$error = "";
$msg_ids = "";
$check_count = 0;
if (isset($_POST['check_mark'])) {
    if (is_array($_POST['check_mark']) && count($_POST['check_mark']) > 1) {
        foreach ($_POST['check_mark'] as $thisnum) {
            if (isnum($thisnum)) {
开发者ID:caveman4572,项目名称:PHP-Fusion,代码行数:31,代码来源:messages.php


示例19: check_captcha

function check_captcha($captchs_encode, $captcha_string)
{
    if (preg_check("/^[0-9A-Za-z]+\$/", $captchs_encode) && preg_check("/^[0-9A-Za-z]+\$/", $captcha_string)) {
        $result = dbquery("SELECT * FROM " . DB_CAPTCHA . " WHERE captcha_ip='" . USER_IP . "' AND captcha_encode='" . $captchs_encode . "' AND captcha_string='" . $captcha_string . "'");
        if (dbrows($result)) {
            $result = dbquery("DELETE FROM " . DB_CAPTCHA . " WHERE captcha_ip='" . USER_IP . "' AND captcha_encode='" . $captchs_encode . "' AND captcha_string='" . $captcha_string . "'");
            return true;
        } else {
            return false;
        }
    } else {
        return false;
    }
}
开发者ID:edwintcloud,项目名称:mycms,代码行数:14,代码来源:maincore.php


示例20: isnum

        if ($_POST['user_hash'] == $user_data['user_password']) {
            if (!preg_match("/^[0-9A-Z@]{6,20}\$/i", $user_new_password)) {
                $error .= $locale['457'] . "<br />\n";
            }
        } else {
            $error .= $locale['458'] . "<br />\n";
        }
    }
}
$user_hide_email = isnum($_POST['user_hide_email']) ? $_POST['user_hide_email'] : "1";
if ($error == "") {
    if (!$user_data['user_avatar'] && !empty($_FILES['user_avatar']['name']) && is_uploaded_file($_FILES['user_avatar']['tmp_name'])) {
        $newavatar = $_FILES['user_avatar'];
        $avatarext = strrchr($newavatar['name'], ".");
        $avatarname = substr($newavatar['name'], 0, strrpos($newavatar['name'], "."));
        if (preg_check("/^[-0-9A-Z_\\[\\]]+\$/i", $avatarname) && preg_check("/(\\.gif|\\.GIF|\\.jpg|\\.JPG|\\.jpeg|\\.JPEG|\\.png|\\.PNG)\$/", $avatarext) && $newavatar['size'] <= 30720) {
            $avatarname = $avatarname . "[" . $userdata['user_id'] . "]" . $avatarext;
            move_uploaded_file($newavatar['tmp_name'], IMAGES . "avatars/" . $avatarname);
            chmod(IMAGES . "avatars/" . $avatarname, 0644);
            $set_avatar = ", user_avatar='" . $avatarname . "'";
            if ($size = @getimagesize(IMAGES . "avatars/" . $avatarname)) {
                if ($size['0'] > 100 || $size['1'] > 100) {
                    @unlink(IMAGES . "avatars/" . $avatarname);
                    $set_avatar = "";
                } elseif (!verify_image(IMAGES . "avatars/" . $avatarname)) {
                    @unlink(IMAGES . "avatars/" . $avatarname);
                    $set_avatar = "";
                }
            } else {
                @unlink(IMAGES . "avatars/" . $avatarname);
                $set_avatar = "";
开发者ID:roniwahyu,项目名称:AKEUDA,代码行数:31,代码来源:updateuser.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP preg_files函数代码示例发布时间:2022-05-15
下一篇:
PHP prefixed函数代码示例发布时间: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