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


PHP check::getIP方法代码示例

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


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

示例1: userLogin

 /**
  * 会员登陆
  * @author	肖飞
  * @param	array $arrUser    会员信息数组
  * @return  void
  */
 public function userLogin($arrData, $isEncryption = 0, $jamStr)
 {
     if (!check::CheckUser($arrData['User'])) {
         check::AlertExit("输入的用户名必须是4-20字符之间的数字、字母或中文!", -1);
         return false;
     }
     if (!check::CheckPassword($arrData['Pass'])) {
         check::AlertExit("输入的密码必须是4-20字符之间的数字、字母!", -1);
         return false;
     }
     $strPassTemp = $arrData['Pass'];
     if ($isEncryption) {
         $strPassTemp = check::strEncryption($strPassTemp, $jamStr);
     }
     $strSQL = "SELECT * FROM {$this->tablename2} WHERE user_name = ? and password = ?";
     $rs = $this->db->prepare($strSQL);
     $rs->execute(array($arrData['User'], $strPassTemp));
     if ($arr = $rs->fetchAll()) {
         $arr = current($this->loadTableFieldG($arr));
         $user_id = '';
         $user_name = '';
         $password = '';
         $real_name = '';
         $user_group = '';
         $user_popedom = '';
         $submit_date = '';
         $pass = '';
         $email = '';
         $tel = '';
         $company_cn = '';
         $user_type = '';
         $user_bonus = '';
         $_SESSION['user_id'] = $arr['user_id'];
         $_SESSION['user_name'] = $arr['user_name'];
         $_SESSION['password'] = $arr['password'];
         $_SESSION['user_group'] = $arr['user_group'];
         $_SESSION['user_grade'] = $arr['user_grade'];
         $_SESSION['user_popedom'] = $arr['user_popedom'];
         $_SESSION['real_name'] = $arr['real_name'];
         $_SESSION['email'] = $arr['email'];
         $_SESSION['tel'] = $arr['tel'];
         $_SESSION['company_cn'] = $arr['company_cn'];
         $_SESSION['user_type'] = $arr['user_type'];
         $_SESSION['user_bonus'] = $arr['user_bonus'];
         $_SESSION['pass'] = $arr['pass'];
         $_SESSION['province'] = $arr['province'];
         $_SESSION['city'] = $arr['city'];
         $_SESSION['type_id'] = $arr['type_id'];
         $arrUpdate['user_ip'] = check::getIP();
         $arrUpdate['lastlog '] = date('Y-m-d H:i:s');
         $arrUpdate['user_id'] = $arr['user_id'];
         $this->updateUser($arrUpdate);
         return true;
     } else {
         return false;
     }
 }
开发者ID:TiMoChao,项目名称:lc_ad_first,代码行数:63,代码来源:user.class.php

示例2: user

 * @subpackage	user
 */
require_once '../config/config.inc.php';
require_once "../class/user.class.php";
require_once '../..' . __WEBADMIN_ROOT . '/checklogin.php';
$objWebInit = new user();
$objWebInit->db();
//访问权限检查
if (!$objWebInit->checkPopedomG($_SESSION['user_id'], 'w', $arrGWeb['module_id'])) {
    check::AlertExit('对不起,您没有写权限', -1);
}
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    $strPassword = trim($_POST['password']);
    $strOldPassword = trim($_POST['oldpassword']);
    $strUser_name = trim($_POST['user_name']);
    $_POST['user_ip'] = check::getIP();
    if ($_POST['user_group'] == 3) {
        unset($_POST['user_popedom']);
    }
    if (empty($strUser_name)) {
        check::AlertExit("用户名不能为空!", -1);
    }
    if (empty($strPassword)) {
        check::AlertExit("密码不能为空!", -1);
    }
    if (empty($_POST['nick_name'])) {
        check::AlertExit("用户昵称不能为空!", -1);
    }
    $strWhere = "where user_name='" . $_POST['user_name'] . "'";
    $arrInfo = check::getAPI('mcenter', 'getUserWhere', "{$strWhere}^user_id");
    if (!empty($arrInfo)) {
开发者ID:TiMoChao,项目名称:xingfu,代码行数:31,代码来源:addinfo.php

示例3: strip_tags

 }
 $arrData['real_name'] = strip_tags(trim($_POST['real_name']));
 $arrData['nick_name'] = strip_tags(trim($_POST['nick_name']));
 $arrData['postcode'] = $_POST['postcode'];
 $arrData['mobile'] = $_POST['mobile'];
 $arrData['email'] = $_POST['email'];
 $arrData['corp_name'] = $_POST['corp_name'];
 $arrData['contact_address'] = $_POST['contact_address'];
 $arrData['question'] = $_POST['question'];
 $arrData['answer'] = $_POST['answer'];
 $arrData['sex'] = $_POST['sex'];
 $arrData['tel'] = $_POST['tel'];
 $arrData['province'] = $_POST['province'];
 $arrData['city'] = $_POST['city'];
 $arrData['area'] = $_POST['area'];
 $arrData['user_ip'] = check::getIP();
 $arrData['submit_date'] = date('Y-m-d H:i:s');
 $arrData['session_id'] = session_id();
 $intID = $objWebInit->saveInfo($arrData, 0, false, true);
 if ($intID) {
     $_SESSION['user_id'] = $intID;
     $_SESSION = array_merge($_SESSION, $arrData);
     $arrTemp['user_id'] = $intID;
     $arrTemp['add_date'] = date('Y-m-d H:i:s');
     $strData = check::getAPIArray($arrTemp);
     check::getAPI('mcenter', 'updateUser', $strData);
     echo "<script>alert('注册完成');window.location='{$arrGWeb['WEB_ROOT_pre']}/';</script>";
     exit;
 } else {
     check::AlertExit('注册失败', -1);
 }
开发者ID:TiMoChao,项目名称:xingfu,代码行数:31,代码来源:regin.php

示例4: define

 *
 * @author		Arthur(ArthurXF@gmail.com)
 * @copyright	(c) 2006 by bizeway.com
 * @version		$Id$
 * @package		ArthurXF
 * @subpackage	logshare
 */
define('__WEB_ROOT', dirname(__FILE__) . "/../..");
define('__LOG_NUMS', 30);
require_once __WEB_ROOT . "/config/global.inc.php";
//日志操作内存存储块
include_once __WEBCOMMON_ROOT . '/SharedMemory/SharedMemory.php';
$objShared = System_SharedMemory::factory();
//$objShared->rm('log');
$arrCache_log = $objShared->get($arrGPdoDB['db_name'] . 'log');
$strIP = check::getIP();
if (!empty($strIP)) {
    $objQQWry = new QQWry();
    $objQQWry->qqwry($strIP);
    $strZone = check::gb2utf8($objQQWry->Country) . check::gb2utf8($objQQWry->Local);
}
if (empty($strZone)) {
    $strZone = $strIP;
}
$strMyUrl = $_SERVER["HTTP_REFERER"];
$strTitle = $_GET['title'];
if (empty($arrCache_log)) {
    if (empty($_SESSION['user_id'])) {
        $arrCache_log['user_log'][] = array('action' => "来自 " . $strZone . " 的访客正在浏览 <a href='" . $strMyUrl . "'>《" . $strTitle . "》</a> ", 'time' => time());
    } else {
        $arrCache_log['user_log'][] = array('action' => "<a href='/user/u_friend_detail/uid-" . $_SESSION['user_id'] . ".html'>{$_SESSION['nick_name']}</a> 正在浏览 <a href='" . $strMyUrl . "'>《" . $strTitle . "》</a>", 'time' => time());
开发者ID:TiMoChao,项目名称:xingfu,代码行数:31,代码来源:logshare.php

示例5: userLogin

 /**
  * 会员登陆
  * @author	肖飞
  * @param	array $arrUser    会员信息数组
  * @return  void
  */
 public function userLogin($arrData, $isEncryption = 0, $jamStr, $isAlert = ture)
 {
     if (!check::CheckUser($arrData['User']) && !check::CheckEmailAddr($_POST['User']) && !check::CheckMobilePhone($_POST['User'])) {
         if ($isAlert) {
             check::AlertExit("输入的用户名必须是4-21字符之间的数字、字母,或7个中文!", -1);
         } else {
             return 0;
         }
     }
     if (!check::CheckPassword($arrData['Pass'])) {
         if ($isAlert) {
             check::AlertExit("输入的密码必须是4-21字符之间的数字、字母!", -1);
         }
         return 0;
     }
     $strPassTemp = $arrData['Pass'];
     if ($isEncryption) {
         $strPassTemp = check::strEncryption($strPassTemp, $jamStr);
     }
     $strUserName = $arrData['User'];
     if ($_SESSION['user_group'] == 3) {
         $strSQL = "SELECT * FROM {$this->tablename1} WHERE user_name = '" . $strUserName . "' and status=1";
         $rs = $this->db->query($strSQL);
     } else {
         $strSQL = "SELECT * FROM {$this->tablename1} WHERE user_name = '" . $strUserName . "' and password = '" . $strPassTemp . "' and status=1";
         $rs = $this->db->query($strSQL);
         if (!($arr = $rs->fetch(PDO::FETCH_ASSOC))) {
             $strSQL = "SELECT * FROM {$this->tablename1} WHERE email  = '" . $strUserName . "' and password = '" . $strPassTemp . "' and status=1";
             $rs = $this->db->query($strSQL);
             if (!($arr = $rs->fetch(PDO::FETCH_ASSOC))) {
                 $strSQL = "SELECT * FROM {$this->tablename1} WHERE mobile  = '" . $strUserName . "' and password = '" . $strPassTemp . "' and status=1";
                 $rs = $this->db->query($strSQL);
                 $arr = $rs->fetch(PDO::FETCH_ASSOC);
             }
         }
     }
     if ($arr) {
         if (is_array($_SESSION)) {
             $_SESSION = array_merge($_SESSION, $arr);
         } else {
             $_SESSION = $arr;
         }
         $arrUpdate = array();
         $arrUpdate['user_ip'] = check::getIP();
         $arrUpdate['lastlog'] = date('Y-m-d H:i:s');
         $arrUpdate['user_id'] = $arr['user_id'];
         $arrUpdate['logtimes'] = ++$arr['logtimes'];
         $arrUpdate['session_id'] = session_id();
         $this->updateUser($arrUpdate);
         return 1;
     } else {
         if ($isAlert) {
             check::AlertExit("用户名或密码错误", -1);
         } else {
             return 0;
         }
     }
 }
开发者ID:TiMoChao,项目名称:xingfu,代码行数:64,代码来源:mcenter.class.php


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