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


PHP HTTP::get_cookie方法代码示例

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


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

示例1: is_mobile

/**
 * 判断是否是合格的手机客户端
 *
 * @return boolean
 */
function is_mobile($ignore_cookie = false)
{
    if (HTTP::get_cookie('_ignore_ua_check') == 'TRUE' and !$ignore_cookie) {
        return false;
    }
    $user_agent = strtolower($_SERVER['HTTP_USER_AGENT']);
    if (preg_match('/playstation/i', $user_agent) or preg_match('/ipad/i', $user_agent) or preg_match('/ucweb/i', $user_agent)) {
        return false;
    }
    if (preg_match('/iemobile/i', $user_agent) or preg_match('/mobile\\ssafari/i', $user_agent) or preg_match('/iphone\\sos/i', $user_agent) or preg_match('/android/i', $user_agent) or preg_match('/symbian/i', $user_agent) or preg_match('/series40/i', $user_agent)) {
        return true;
    }
    return false;
}
开发者ID:chenruixuan,项目名称:wecenter,代码行数:19,代码来源:functions.inc.php

示例2: register_process_action

 public function register_process_action()
 {
     $fack = $this->model('account')->fack_insert($_POST['user_name'], $_POST['password'], $_POST['email']);
     if (get_setting('register_type') == 'close') {
         H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('本站目前关闭注册')));
     } else {
         if (get_setting('register_type') == 'invite' and !$_POST['icode']) {
             H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('本站只能通过邀请注册')));
         } else {
             if (get_setting('register_type') == 'weixin') {
                 H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('本站只能通过微信注册')));
             }
         }
     }
     if ($_POST['icode']) {
         if (!($invitation = $this->model('invitation')->check_code_available($_POST['icode'])) and $_POST['email'] == $invitation['invitation_email']) {
             H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('邀请码无效或与邀请邮箱不一致')));
         }
     }
     if ($_POST['user_name'] == '') {
         H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('请输入用户名')));
     } else {
         if ($this->model('account')->check_username($_POST['user_name'])) {
             H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('用户名已经存在')));
         }
     }
     /*
     		else if (!$this->model('account')->check_yqm($_POST['yqm']))
     				
     		{
     			H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('邀请码无效或与邀请邮箱不一致')));
     
     		}
     	
     		
     	else if ($check_rs = $this->model('account')->check_username_char($_POST['user_name']))
     		{
     			H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('用户名包含无效字符')));
     		}
     		else if ($this->model('account')->check_username_sensitive_words($_POST['user_name']) OR trim($_POST['user_name']) != $_POST['user_name'])
     		{
     
     			H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('用户名中包含敏感词或系统保留字')));
     		}
     
     		if ($this->model('account')->check_email($_POST['email']))
     		{
     			H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('E-Mail 已经被使用, 或格式不正确')));
     		}
     
     
     		if (strlen($_POST['password']) < 6 OR strlen($_POST['password']) > 16)
     		{
     			H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('密码长度不符合规则')));
     		}
     */
     if (!$_POST['agreement_chk']) {
         H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('你必需同意用户协议才能继续')));
     }
     // 检查验证码
     if (!AWS_APP::captcha()->is_validate($_POST['seccode_verify']) and get_setting('register_seccode') == 'Y') {
         H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('请填写正确的验证码')));
     }
     if (get_setting('ucenter_enabled') == 'Y') {
         $result = $this->model('ucenter')->register($_POST['user_name'], $_POST['password'], $_POST['email']);
         if (is_array($result)) {
             $uid = $result['user_info']['uid'];
         } else {
             H::ajax_json_output(AWS_APP::RSM(null, -1, $result));
         }
     } else {
         $uid = $this->model('account')->user_register($_POST['user_name'], $_POST['password'], $_POST['email']);
     }
     if ($_POST['email'] == $invitation['invitation_email']) {
         $this->model('active')->set_user_email_valid_by_uid($uid);
         $this->model('active')->active_user_by_uid($uid);
     }
     if (isset($_POST['sex'])) {
         $update_data['sex'] = intval($_POST['sex']);
         if ($_POST['province']) {
             $update_data['province'] = $_POST['province'];
             $update_data['city'] = $_POST['city'];
         }
         if ($_POST['job_id']) {
             $update_data['job_id'] = intval($_POST['job_id']);
         }
         $update_attrib_data['signature'] = $_POST['signature'];
         // 更新主表
         $this->model('account')->update_users_fields($update_data, $uid);
         // 更新从表
         $this->model('account')->update_users_attrib_fields($update_attrib_data, $uid);
     }
     $this->model('account')->setcookie_logout();
     $this->model('account')->setsession_logout();
     if ($_POST['icode']) {
         $follow_users = $this->model('invitation')->get_invitation_by_code($_POST['icode']);
     } else {
         if (HTTP::get_cookie('fromuid')) {
             $follow_users = $this->model('account')->get_user_info_by_uid(HTTP::get_cookie('fromuid'));
         }
//.........这里部分代码省略.........
开发者ID:leonardo0004,项目名称:wecenter-loudong,代码行数:101,代码来源:ajax.php

示例3: register_process_action

 public function register_process_action()
 {
     if (get_setting('register_type') == 'close') {
         H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('本站目前关闭注册')));
     } else {
         if (get_setting('register_type') == 'invite' and !$_POST['icode']) {
             H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('本站只能通过邀请注册')));
         } else {
             if (get_setting('register_type') == 'weixin') {
                 H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('本站只能通过微信注册')));
             }
         }
     }
     if ($_POST['icode']) {
         if (!($invitation = $this->model('invitation')->check_code_available($_POST['icode'])) and $_POST['email'] == $invitation['invitation_email']) {
             H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('邀请码无效或与邀请邮箱不一致')));
         }
     }
     if (trim($_POST['user_name']) == '') {
         H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('请输入用户名')));
     } else {
         if ($this->model('account')->check_username($_POST['user_name'])) {
             H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('用户名已经存在')));
         } else {
             if ($check_rs = $this->model('account')->check_username_char($_POST['user_name'])) {
                 H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('用户名包含无效字符')));
             } else {
                 if ($this->model('account')->check_username_sensitive_words($_POST['user_name']) or trim($_POST['user_name']) != $_POST['user_name']) {
                     H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('用户名中包含敏感词或系统保留字')));
                 }
             }
         }
     }
     if ($this->model('account')->check_email($_POST['email'])) {
         H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('E-Mail 已经被使用, 或格式不正确')));
     }
     if (strlen($_POST['password']) < 6 or strlen($_POST['password']) > 16) {
         H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('密码长度不符合规则')));
     }
     // if (! $_POST['agreement_chk'])
     // {
     // 	H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('你必需同意用户协议才能继续')));
     // }
     // 检查验证码
     // if (!AWS_APP::captcha()->is_validate($_POST['seccode_verify']) AND get_setting('register_seccode') == 'Y')
     // {
     // 	H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('请填写正确的验证码')));
     // }
     if (get_setting('ucenter_enabled') == 'Y') {
         $result = $this->model('ucenter')->register($_POST['user_name'], $_POST['password'], $_POST['email']);
         if (is_array($result)) {
             $uid = $result['user_info']['uid'];
         } else {
             H::ajax_json_output(AWS_APP::RSM(null, -1, $result));
         }
     } else {
         $uid = $this->model('account')->user_register($_POST['user_name'], $_POST['password'], $_POST['email']);
     }
     if ($_POST['email'] == $invitation['invitation_email']) {
         $this->model('active')->set_user_email_valid_by_uid($uid);
         $this->model('active')->active_user_by_uid($uid);
     }
     $this->model('account')->setcookie_logout();
     $this->model('account')->setsession_logout();
     if ($_POST['icode']) {
         $follow_users = $this->model('invitation')->get_invitation_by_code($_POST['icode']);
     } else {
         if (HTTP::get_cookie('fromuid')) {
             $follow_users = $this->model('account')->get_user_info_by_uid(HTTP::get_cookie('fromuid'));
         }
     }
     if ($follow_users['uid']) {
         $this->model('follow')->user_follow_add($uid, $follow_users['uid']);
         $this->model('follow')->user_follow_add($follow_users['uid'], $uid);
         $this->model('integral')->process($follow_users['uid'], 'INVITE', get_setting('integral_system_config_invite'), '邀请注册: ' . $_POST['user_name'], $follow_users['uid']);
     }
     if ($_POST['icode']) {
         $this->model('invitation')->invitation_code_active($_POST['icode'], time(), fetch_ip(), $uid);
     }
     if (get_setting('register_valid_type') == 'N' or get_setting('register_valid_type') == 'email' and get_setting('register_type') == 'invite') {
         $this->model('active')->active_user_by_uid($uid);
     }
     $user_info = $this->model('account')->get_user_info_by_uid($uid);
     if (get_setting('register_valid_type') == 'N' or $user_info['group_id'] != 3 or $_POST['email'] == $invitation['invitation_email']) {
         $valid_email = 1;
     } else {
         AWS_APP::session()->valid_email = $user_info['email'];
         $this->model('active')->new_valid_email($uid);
         $valid_email = 0;
     }
     $this->model('account')->setcookie_login($user_info['uid'], $user_info['user_name'], $_POST['password'], $user_info['salt']);
     H::ajax_json_output(AWS_APP::RSM(array('uid' => $user_info['uid'], 'user_name' => $user_info['user_name'], 'valid_email' => $valid_email), 1, null));
 }
开发者ID:androiddream,项目名称:WeCenterMobile-Api,代码行数:93,代码来源:account.php

示例4: register_process_action

 public function register_process_action()
 {
     if (get_setting('register_type') == 'close') {
         H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('��վĿǰ�ر�ע��')));
     } else {
         if (get_setting('register_type') == 'invite' and !$_POST['icode']) {
             H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('��վֻ��ͨ������ע��')));
         } else {
             if (get_setting('register_type') == 'weixin') {
                 H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('��վֻ��ͨ��΢��ע��')));
             }
         }
     }
     if ($_POST['icode']) {
         if (!($invitation = $this->model('invitation')->check_code_available($_POST['icode'])) and $_POST['email'] == $invitation['invitation_email']) {
             H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('��������Ч�����������䲻һ��')));
         }
     }
     if (trim($_POST['user_name']) == '') {
         H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('�������û���')));
     } else {
         if ($this->model('account')->check_username($_POST['user_name'])) {
             H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('�û����Ѿ�����')));
         } else {
             if ($check_rs = $this->model('account')->check_username_char($_POST['user_name'])) {
                 H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('�û������Ч�ַ�')));
             } else {
                 if ($this->model('account')->check_username_sensitive_words($_POST['user_name']) or trim($_POST['user_name']) != $_POST['user_name']) {
                     H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('�û����а���дʻ�ϵͳ������')));
                 }
             }
         }
     }
     if ($this->model('account')->check_email($_POST['email'])) {
         H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('E-Mail �Ѿ���ʹ��, ���ʽ����ȷ')));
     }
     if (strlen($_POST['password']) < 6 or strlen($_POST['password']) > 16) {
         H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('���볤�Ȳ���Ϲ���')));
     }
     if (!$_POST['agreement_chk']) {
         H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('�����ͬ���û�Э����ܼ���')));
     }
     // �����֤��
     if (!AWS_APP::captcha()->is_validate($_POST['seccode_verify']) and get_setting('register_seccode') == 'Y') {
         H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('����д��ȷ����֤��')));
     }
     if (get_setting('ucenter_enabled') == 'Y') {
         $result = $this->model('ucenter')->register($_POST['user_name'], $_POST['password'], $_POST['email']);
         if (is_array($result)) {
             $uid = $result['user_info']['uid'];
         } else {
             H::ajax_json_output(AWS_APP::RSM(null, -1, $result));
         }
     } else {
         $uid = $this->model('account')->user_register($_POST['user_name'], $_POST['password'], $_POST['email']);
     }
     if ($_POST['email'] == $invitation['invitation_email']) {
         $this->model('active')->set_user_email_valid_by_uid($uid);
         $this->model('active')->active_user_by_uid($uid);
     }
     if (isset($_POST['sex'])) {
         $update_data['sex'] = intval($_POST['sex']);
         if ($_POST['province']) {
             $update_data['province'] = htmlspecialchars($_POST['province']);
             $update_data['city'] = htmlspecialchars($_POST['city']);
         }
         if ($_POST['job_id']) {
             $update_data['job_id'] = intval($_POST['job_id']);
         }
         $update_attrib_data['signature'] = htmlspecialchars($_POST['signature']);
         // �������
         $this->model('account')->update_users_fields($update_data, $uid);
         // ���´ӱ�
         $this->model('account')->update_users_attrib_fields($update_attrib_data, $uid);
     }
     $this->model('account')->setcookie_logout();
     $this->model('account')->setsession_logout();
     if ($_POST['icode']) {
         $follow_users = $this->model('invitation')->get_invitation_by_code($_POST['icode']);
     } else {
         if (HTTP::get_cookie('fromuid')) {
             $follow_users = $this->model('account')->get_user_info_by_uid(HTTP::get_cookie('fromuid'));
         }
     }
     if ($follow_users['uid']) {
         $this->model('follow')->user_follow_add($uid, $follow_users['uid']);
         $this->model('follow')->user_follow_add($follow_users['uid'], $uid);
         $this->model('integral')->process($follow_users['uid'], 'INVITE', get_setting('integral_system_config_invite'), '����ע��: ' . $_POST['user_name'], $follow_users['uid']);
     }
     if ($_POST['icode']) {
         $this->model('invitation')->invitation_code_active($_POST['icode'], time(), fetch_ip(), $uid);
     }
     if (get_setting('register_valid_type') == 'N' or get_setting('register_valid_type') == 'email' and get_setting('register_type') == 'invite') {
         $this->model('active')->active_user_by_uid($uid);
     }
     $user_info = $this->model('account')->get_user_info_by_uid($uid);
     if (get_setting('register_valid_type') == 'N' or $user_info['group_id'] != 3 or $_POST['email'] == $invitation['invitation_email']) {
         $this->model('account')->setcookie_login($user_info['uid'], $user_info['user_name'], $_POST['password'], $user_info['salt']);
         if (!$_POST['_is_mobile']) {
             H::ajax_json_output(AWS_APP::RSM(array('url' => get_js_url('/home/first_login-TRUE')), 1, null));
//.........这里部分代码省略.........
开发者ID:lincoln2015,项目名称:18duchengxuyuan_server,代码行数:101,代码来源:ajax.php


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