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


PHP referer函数代码示例

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


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

示例1: index

 public function index()
 {
     global $_W, $_GPC;
     $set = $this->getSet();
     if (checksubmit('submit')) {
         $set['user'] = is_array($_GPC['user']) ? $_GPC['user'] : array();
         $this->updateSet($set);
         if (!empty($set['user']['upload'])) {
             $ret = $this->check($set['user']);
             if (empty($ret)) {
                 message('配置有误,请仔细检查参数设置!', '', 'error');
             }
         }
         message('设置保存成功!', referer(), 'success');
     }
     if (checksubmit('submit_admin')) {
         $set['admin'] = is_array($_GPC['admin']) ? $_GPC['admin'] : array();
         $this->updateSet($set);
         if (!empty($set['admin']['upload'])) {
             $ret = $this->check($set['admin']);
             if (empty($ret)) {
                 message('配置有误,请仔细检查参数设置!', '', 'error');
             }
         }
         message('设置保存成功!', referer(), 'success');
     }
     include $this->template('set');
 }
开发者ID:noikiy,项目名称:mygit,代码行数:28,代码来源:web.php

示例2: main

	public function main()
	{
		$this->Title = '下载手机版享更多优惠';
		$android_url = ini('settings.site_url').'/get-last-apk.php';
		$iphone = ini('iphone');
		$iphone_url = $iphone['url'];

		$referer_url = referer('index.php?');
		if(false !== strpos($referer_url, '?')) {
			$referer_url .= '&ignore_jump=1';
		} else {
			$referer_url .= '/ignore_jump-1';
		}

		$user_agent = $_SERVER['HTTP_USER_AGENT'];
		if (stripos($user_agent, 'MicroMessenger') === false) {
						if( false != preg_match("/(iphone|android|mobile)/i",$_SERVER['HTTP_USER_AGENT']) ) {
				include handler('template')->file('downapp_mobile');
			} else {
				include handler('template')->file('downapp');	
			}
		} else {
						include handler('template')->file('downapp_weixin');
		}
	}
开发者ID:pf5512,项目名称:phpstudy,代码行数:25,代码来源:downapp.mod.php

示例3: doWebAddInfo

 public function doWebAddInfo()
 {
     global $_W, $_GPC;
     load()->func('tpl');
     $infoid = intval($_GPC['infoid']);
     if ($infoid) {
         $info = pdo_fetch("SELECT * FROM " . tablename('water_query_info') . " WHERE id= " . $infoid);
     }
     if ($_GPC['op'] == 'delete') {
         $infoid = intval($_GPC['infoid']);
         $info = pdo_fetch("SELECT id FROM " . tablename('water_query_info') . " WHERE id = " . $infoid);
         if (empty($info)) {
             message('抱歉,信息不存在或是已经被删除!');
         }
         pdo_delete('water_query_info', array('id' => $infoid));
         message('删除成功!', referer(), 'success');
     }
     if (checksubmit()) {
         $data = array('keyword' => $_GPC['keyword'], 'info' => htmlspecialchars_decode($_GPC['info']), 'infophoto' => $_GPC['infophoto']);
         if (!empty($infoid)) {
             pdo_update('water_query_info', $data, array('id' => $infoid));
         } else {
             $data['uniacid'] = $_W['uniacid'];
             pdo_insert('water_query_info', $data);
             $infoid = pdo_insertid();
         }
         message('更新成功!', referer(), 'success');
     }
     include $this->template('addinfo');
 }
开发者ID:aspnmy,项目名称:weizan,代码行数:30,代码来源:site.php

示例4: doWebManage

 public function doWebManage()
 {
     global $_W, $_GPC;
     $data = array();
     if ($_W['ispost']) {
         if (empty($_GPC['items'])) {
             message('创建点内容吧!', referer(), 'error', 1);
         }
         $data['weid'] = $_W['weid'];
         $data['title'] = $_GPC['title'];
         $data['bgimg'] = $_GPC['bgimg'];
         $data['bgcol'] = $_GPC['bgcol'];
         $data['time'] = time();
         foreach ($_GPC['items']['type'] as $k => $val) {
             $data['items'][] = array('type' => $_GPC['items']['type'][$k], 'title' => $_GPC['items']['title'][$k], 'direct' => $_GPC['items']['direct'][$k], 'detail' => $_GPC['items']['detail'][$k]);
         }
         $data['items'] = serialize($data['items']);
         if (empty($_GPC['id'])) {
             pdo_insert('timeaxis', $data);
         } else {
             pdo_update('timeaxis', $data, array('id' => $_GPC['id']));
         }
         //WeUtility::logging('tips','items:'.$data['items']);
         message('活动创建成功', '', 'success', 1);
     }
     $timeinf = array();
     if (!empty($_GPC['id'])) {
         $timeinf = pdo_fetch('SELECT * FROM ' . tablename('timeaxis') . ' WHERE id=:id', array(':id' => $_GPC['id']));
         $timeinf['items'] = unserialize($timeinf['items']);
         $timeinf['url'] = $this->createMobileUrl('index', array('weid' => $_W['weid'], 'tid' => $_GPC['id']));
     }
     include $this->template('manage');
 }
开发者ID:alextiannus,项目名称:wormwood_wechat,代码行数:33,代码来源:site.php

示例5: doWebCredit

 public function doWebCredit()
 {
     // 1. display reservation
     // 2. add credit
     // 3. delete credit
     // 4. update credit
     global $_W;
     global $_GPC;
     // 获取query string中的参数
     $operation = !empty($_GPC['op']) ? $_GPC['op'] : 'display';
     if ($operation == 'delete') {
         //删除兑换请求
         $id = intval($_GPC['id']);
         $row = pdo_fetch("SELECT id FROM " . tablename('credit_request') . " WHERE id = :id", array(':id' => $id));
         if (empty($row)) {
             message('抱歉,编号为' . $id . '的兑换请求不存在或是已经被删除!');
         }
         pdo_delete('credit_request', array('id' => $id));
         message('删除成功!', referer(), 'success');
     } else {
         if ($operation == 'display') {
             $condition = '';
             $sql = "SELECT * FROM " . tablename('award_list') . " as t1," . tablename('credit_request') . "as t2 WHERE t1.award_id=t2.award_id AND t1.weid = '{$_W['weid']}' ORDER BY t2.createtime DESC";
             $list = pdo_fetchall($sql);
             $ar = pdo_fetchall($sql, array(), 'from_user');
             $fans = fans_search(array_keys($ar), array('realname', 'mobile', 'credit1', 'residedist'));
         }
     }
     include $this->template('credit_request');
 }
开发者ID:alextiannus,项目名称:wormwood_wechat,代码行数:30,代码来源:site.php

示例6: doWebsetting

 public function doWebsetting()
 {
     global $_W, $_GPC;
     $weid = $_W['uniacid'];
     load()->func('tpl');
     $subject = pdo_fetch("SELECT * FROM " . tablename(hc_ybdzs_setting) . " WHERE weid = '{$weid}' ORDER BY id DESC LIMIT 1");
     $item['hc_ybdzs_title'] = empty($item['hc_ybdzs_title']) ? '月饼大战' : $item['hc_ybdzs_title'];
     $item['share_desc'] = empty($item['share_desc']) ? '我只用了一层功力,已经无人可及了!' : $item['share_desc'];
     $item['wechat'] = empty($item['wechat']) ? '导流标题' : $item['wechat'];
     $item['hc_ybdzs_url'] = empty($item['hc_ybdzs_url']) ? 'http://52jscn.com' : $item['hc_ybdzs_url'];
     if (checksubmit()) {
         $data = array('hc_ybdzs_title' => $_GPC['hc_ybdzs_title'], 'hc_ybdzs_url' => $_GPC['hc_ybdzs_url'], 'share_desc' => $_GPC['share_desc'], 'wechat' => $_GPC['wechat'], 'counts' => $_GPC['counts'], 'photo' => $_GPC['photo']);
         if (empty($subject)) {
             $data['weid'] = $weid;
             pdo_insert(hc_ybdzs_setting, $data);
         } else {
             pdo_update(hc_ybdzs_setting, $data, array('weid' => $weid));
         }
         message('欧了!欧了!更新完毕!', referer(), 'success');
     }
     if (!$subject['photo']) {
         $subject = array("photo" => "../addons/hc_ybdzs/template/mobile/b.gif");
     }
     include $this->template('setting');
 }
开发者ID:eduNeusoft,项目名称:weixin,代码行数:25,代码来源:site.php

示例7: message

function message($msg, $redirect = '', $type = '')
{
    global $_W;
    if ($redirect == 'refresh') {
        $redirect = $_W['script_name'] . '?' . $_SERVER['QUERY_STRING'];
    }
    if ($redirect == 'referer') {
        $redirect = referer();
    }
    if ($redirect == '') {
        $type = in_array($type, array('success', 'error', 'info', 'warning', 'ajax', 'sql')) ? $type : 'info';
    } else {
        $type = in_array($type, array('success', 'error', 'info', 'warning', 'ajax', 'sql')) ? $type : 'success';
    }
    if ($_W['isajax'] || $type == 'ajax') {
        $vars = array();
        $vars['message'] = $msg;
        $vars['redirect'] = $redirect;
        $vars['type'] = $type;
        exit(json_encode($vars));
    }
    if (empty($msg) && !empty($redirect)) {
        header('location: ' . $redirect);
    }
    $label = $type;
    if ($type == 'error') {
        $label = 'danger';
    }
    if ($type == 'ajax' || $type == 'sql') {
        $label = 'warning';
    }
    include template('common/message', TEMPLATE_INCLUDEPATH);
    exit;
}
开发者ID:legeng,项目名称:project-2,代码行数:34,代码来源:common.func.php

示例8: login

	function login()
	{
		$this->_fix_failedlogins();

		if(MEMBER_ID < 1)
		{
			$this->Messager("请先在前台进行<a href='index.php?mod=account&code=login'><b>登录</b></a>",null);
		}
		$loginperm = $this->_logincheck();
		if(!$loginperm) {
			$this->Messager("累计 5 次错误尝试,15 分钟内您将不能登录。",null);
		}
		$this->Title="用户登录";
		if ($this->CookieHandler->GetVar('referer')=='')
		{
			$this->CookieHandler->Setvar('referer',referer());
		}
		$action="admin.php?mod=login&code=dologin";

		$question_select=FormHandler::Select('question',ConfigHandler::get('member','question_list'),0);
		$role_type_select=FormHandler::Radio('role_type',ConfigHandler::get('member','role_type_list'),'normal');
		ob_clean();

		include(handler('template')->file("@admin/login"));
	}
开发者ID:pf5512,项目名称:phpstudy,代码行数:25,代码来源:login.mod.php

示例9: settingsDisplay

 public function settingsDisplay($settings)
 {
     global $_W, $_GPC;
     if (checksubmit('submit')) {
         $this->editSetting($_GPC);
         message('配置参数更新成功!', referer(), 'success');
     }
     $member_table = str_replace("`", "", tablename("mc_members"));
     $sql = "SELECT\r\n\t\t\tCOLUMN_NAME,\r\n\t\t\tcolumn_comment\r\n\t\tFROM\r\n\t\t\tINFORMATION_SCHEMA. COLUMNS\r\n\t\tWHERE\r\n\t\t\ttable_name = '{$member_table}'";
     $column = pdo_fetchall($sql);
     $sql = "select * from " . tablename("fl_dkf_column") . " where weid={$_W['weid']}";
     $wcolumn = pdo_fetchall($sql);
     if (!$wcolumn) {
         $sql = "select * from " . tablename("fl_dkf_column") . " where weid=0";
         $wcolumn = pdo_fetchall($sql);
     }
     foreach ($wcolumn as $key => $value) {
         $wcolumn_keys[$value['column_name']] = $value;
     }
     foreach ($column as $key => $value) {
         $column[$key]['column_show_name'] = $wcolumn_keys[$value['COLUMN_NAME']]['column_show_name'];
         $column[$key]['is_show'] = $wcolumn_keys[$value['COLUMN_NAME']]['is_show'];
         $column[$key]['is_edit'] = $wcolumn_keys[$value['COLUMN_NAME']]['is_edit'];
     }
     include $this->template('setting');
 }
开发者ID:aspnmy,项目名称:weizan,代码行数:26,代码来源:module.php

示例10: settingsDisplay

 public function settingsDisplay($settings)
 {
     global $_W, $_GPC;
     load()->func('tpl');
     $config = $this->module['config'];
     if (empty($config['hlogo'])) {
         $config['hlogo'] = MODULE_URL . 'template/style/img/logo.png';
     }
     if (empty($config['flogo'])) {
         $config['flogo'] = MODULE_URL . 'template/style/img/un-logo.png';
     }
     if (empty($config['target'])) {
         $config['target'] = MODULE_URL . 'template/style/img/husky.png';
     }
     if (checksubmit()) {
         $dat = $_GPC['dat'];
         $dat['hlogo'] = $_GPC['hlogo'];
         $dat['flogo'] = $_GPC['flogo'];
         $dat['target'] = $_GPC['target'];
         $this->saveSettings($dat);
         message('设置成功..', referer(), 'success');
     }
     //这里来展示设置项表单
     include $this->template('setting');
 }
开发者ID:eduNeusoft,项目名称:weixin,代码行数:25,代码来源:module.php

示例11: doWebTalklist

 public function doWebTalklist()
 {
     global $_W, $_GPC;
     $pageIndex = max(1, intval($_GPC['page']));
     $pageSize = 50;
     $total = pdo_fetchcolumn("SELECT COUNT(*) FROM " . tablename($this->table_comments) . " WHERE `uniacid`=:uniacid  ", array(':uniacid' => $_W['uniacid']));
     if ($_GPC['foo'] == 'change') {
         if (empty($_GPC['id'])) {
             message('缺失重要的参数', '', 'error');
         }
         pdo_update($this->table_comments, array('isok' => $_GPC['doit']), array('uniacid' => $_W['uniacid'], 'id' => $_GPC['id']));
         message('哎呦,状态修改成功了哦', referer(), 'success');
     }
     if ($_GPC['foo'] == 'delete') {
         if (empty($_GPC['id'])) {
             message('缺失重要的参数', '', 'error');
         }
         pdo_delete($this->table_comments, array('id' => $_GPC['id'], 'uniacid' => $_W['uniacid']));
         message('哎呦,删除了哦..', referer(), 'success');
     }
     $list = pdo_fetchall('SELECT * FROM' . tablename($this->table_comments) . " WHERE uniacid = :uniacid GROUP BY createtime DESC LIMIT " . ($pageIndex - 1) * $pageSize . ',' . $pageSize, array(':uniacid' => $_W['uniacid']));
     foreach ($list as $key => $value) {
         $temp = pdo_fetch('SELECT * FROM' . tablename($this->table_fans) . " WHERE uniacid = :uniacid AND openid = :openid", array(':uniacid' => $_W['uniacid'], ':openid' => $value['openid']));
         $list[$key]['nickname'] = $temp['nickname'];
     }
     $pager = pagination($total, $pageIndex, $pageSize);
     include $this->template('talklist');
 }
开发者ID:6662680,项目名称:qday_wx,代码行数:28,代码来源:site.php

示例12: doWebdatadelete

 public function doWebdatadelete()
 {
     global $_W, $_GPC;
     $uniacid = $_W['uniacid'];
     $id = $_GPC['id'];
     pdo_delete("lee_tlvoice_record", array('id' => $id));
     message("删除成功", referer(), 'success');
 }
开发者ID:keycoolkui,项目名称:weixinfenxiao,代码行数:8,代码来源:site.php

示例13: Login

 function Login()
 {
     if (jsg_getcookie("referer") == "") {
         jsg_setcookie("referer", referer('?', 1));
     }
     $aurl = $this->_get_oauth_url();
     $this->Messager(null, $aurl);
 }
开发者ID:YouthAndra,项目名称:huaitaoo2o,代码行数:8,代码来源:qqwb.mod.php

示例14: doWebstatus

 public function doWebstatus($rid = 0)
 {
     global $_GPC;
     $rid = $_GPC['rid'];
     echo $rid;
     $insert = array('status' => $_GPC['status']);
     pdo_update($this->table_reply, $insert, array('rid' => $rid));
     message('模块操作成功!', referer(), 'success');
 }
开发者ID:alextiannus,项目名称:wormwood_wechat,代码行数:9,代码来源:site.php

示例15: doWebDelete

 public function doWebDelete()
 {
     global $_W, $_GPC;
     $id = $_GPC['id'];
     if (!empty($id)) {
         pdo_delete($this->manage, array('weid' => $_W['weid'], 'id' => $id));
         message('删除成功', referer(), 'success');
     }
 }
开发者ID:alextiannus,项目名称:wormwood_wechat,代码行数:9,代码来源:site.php


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