本文整理汇总了PHP中jump函数的典型用法代码示例。如果您正苦于以下问题:PHP jump函数的具体用法?PHP jump怎么用?PHP jump使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了jump函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: main
function main()
{
if (isset($_REQUEST['a'])) {
jump($_REQUEST["a"]);
}
main_page();
}
示例2: _initialize
function _initialize()
{
$model = M('config');
$list = $model->select();
foreach ($list as $v) {
$GLOBALS[$v['varname']] = $v['value'];
}
import('ORG.File');
import('ORG.Plugin');
//设置发信配置
C('MAIL_ADDRESS', $GLOBALS['cfg_smtp_usermail']);
C('MAIL_SMTP', $GLOBALS['cfg_smtp_server']);
C('MAIL_LOGINNAME', $GLOBALS['cfg_smtp_user']);
C('MAIL_PASSWORD', $GLOBALS['cfg_smtp_password']);
//登陆判断
$this->isLogin() ? define('USER_LOGINED', true) : define('USER_LOGINED', false);
global $cfg_mb_open, $cfg_mb_reginfo;
if ($cfg_mb_open == 1) {
$this->error('系统会员功能已禁用!');
}
//缓存用户信息
if (USER_LOGINED == true) {
$model = M('member');
$list = $model->where(array('id' => cookie('uid')))->find();
$GLOBALS['member'] = $list;
if ($list['status'] == 1 && !in_array(MODULE_NAME, array('Index', 'Public'))) {
jump(U('Index/myfile'));
}
}
}
示例3: checklogin
function checklogin($x)
{
global $islogin;
/*
home.php 对应 islogin = 1
login.php 对应 islogin = 2
如果session == 1,但此刻不在home.php($islogin!=1),那么就跳到home.php
如果session没设置,且此刻不在login.php($islogin!=2),那么就跳到login.php
*/
if ($x) {
if ($islogin != 1) {
jump('home.php');
}
} else {
if ($islogin != 2) {
jump('login.php');
}
}
/*
if($x){
if($x==1){
if($islogin!=1){
jump('home.php');
}
}else{
jump('login.php');
}
}elseif($islogin!=2){
jump('login.php');
}
*/
}
示例4: main
function main()
{
if (!isset($_REQUEST['a'])) {
$_REQUEST['a'] = '';
}
jump($_REQUEST["a"]);
}
示例5: check_login
public final function check_login()
{
if (M == 'admin' && C == 'index' && A == 'login') {
return true;
} else {
$userid = getCookie('userid');
if (!isset($_SESSION['userid']) || !isset($_SESSION['roleid']) || !$_SESSION['userid'] || !$_SESSION['roleid'] || $userid != $_SESSION['userid']) {
jump('登陆', '?m=admin&c=index&a=login');
}
}
}
示例6: checksafeauth
protected function checksafeauth()
{
$safeauth = F('safeauth', '', COMMON_PATH);
if (empty($safeauth)) {
jump(U('Index/main'));
}
$safeauthset = cookie('safeauthset');
if (empty($safeauthset)) {
$this->display('Public:checksafeauth');
exit;
}
}
示例7: logining
public function logining()
{
$username = isset($_POST['username']) ? htmlspecialchars(trim($_POST['username'])) : '';
$password = isset($_POST['password']) ? htmlspecialchars(trim($_POST['password'])) : '';
//查询用户名和密码是否正确
$rs = User::isUsernamePassWord($username, $password);
if ($rs) {
$url = User::getUserLoginUrl($rs['id']);
} else {
$url = url("myweb", "login::index");
}
jump($url);
}
示例8: check_permission
/**
* 验证用户是否有权限
* @param string $name
* @return string
*/
public function check_permission($name)
{
if (!empty($_SESSION)) {
foreach ($_SESSION['permission'] as $value) {
$check_array[] = $value['fname'];
}
if (!in_array($name, $check_array)) {
jump('您没有这样的操作权限', "pages/404.php", '', 0);
die;
} else {
return $name;
}
}
}
示例9: doTopLogin
public function doTopLogin()
{
$data['username'] = I('post.email');
$data['password'] = I('post.password');
$data['password'] = md5($data['password']);
//查询数据库
$userres = M('users')->where($data)->find();
//如果存在,写入session ,返回session数组
if ($userres) {
//写入session
session('user', $userres);
//返回成功信息
jump('登陆成功', __APP__);
} else {
jump('用户名或密码错误', __APP__);
}
}
示例10: isLogin
public static function isLogin()
{
if (!self::_isLogin()) {
if ($_COOKIE['is_login']) {
$username = $_COOKIE['is_login']['username'];
$rs = self::getUserInfoByUsername($username);
if ($rs) {
self::userLogin($rs[0]['id']);
return true;
} else {
return false;
}
} else {
$last_url = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : HOMEURL;
LuS::set('last_url', $last_url);
$url = url("login", "login::index");
jump($url);
}
} else {
return true;
}
}
示例11: compute
function compute($registers, $input)
{
while ($row = current($input)) {
#echo "$row\n";
$parts = explode(" ", $row);
$cmd = array_shift($parts);
$reg = str_replace(",", "", array_shift($parts));
$val = $parts ? (int) array_shift($parts) : false;
switch ($cmd) {
case "hlf":
$registers[$reg] /= 2;
break;
case "tpl":
$registers[$reg] *= 3;
break;
case "inc":
$registers[$reg] += 1;
break;
case "jmp":
jump($reg, $input);
break;
case "jie":
if ($registers[$reg] % 2 == 0) {
jump($val, $input);
}
break;
case "jio":
if ($registers[$reg] == 1) {
jump($val, $input);
}
break;
default:
echo "wtf!!\n";
}
next($input);
}
return $registers;
}
示例12: adminCheck
/**
* 管理员权限验证
*
*/
function adminCheck($permission = '')
{
openSession();
if (empty($_SESSION['admin'])) {
jump(U('index/login'));
}
$adm = json_decode($_SESSION['admin']);
if (empty($adm)) {
echo 'no adm';
exit;
}
if (!empty($permission)) {
$adm = json_decode($_SESSION['admin']);
$p = ',' . $adm->a_permission . ',';
if (!is_numeric(strpos($p, ',superadmin,'))) {
$permission = ',' . $permission . ',';
if (!is_numeric(strpos($p, $permission))) {
echo '您没权限访问此页面';
exit;
}
}
}
}
示例13: session_start
<?php
//开启session
session_start();
//设置字符集
header("content-type:text/html;charset=utf-8");
//定义绝对路径
define('PATH', str_replace('\\', '/', dirname(__FILE__)) . '/../');
$des = strtolower(explode('/', $_SERVER['SERVER_PROTOCOL'])[0]) . '://' . $_SERVER['SERVER_NAME'];
$search = $_SERVER['DOCUMENT_ROOT'];
//用于跳转
define('APP', str_replace($search, $des, PATH));
include PATH . 'include/config.php';
include PATH . 'include/funcs.php';
if (!isset($_SESSION['login']['lv'])) {
exit(jump('还没有登陆', APP . 'login.php'));
}
?>
示例14: define
<?php
/*
Xiuno BBS 3.0 插件实例
广告插件卸载程序
*/
define('DEBUG', 1);
// 发布的时候改为 0
define('APP_NAME', 'bbs');
// 应用的名称
define('APP_PATH', '../../');
// 应用的路径
chdir(APP_PATH);
$conf = (include './conf/conf.php');
include './xiunophp/xiunophp.php';
include './model.inc.php';
$pconf = xn_json_decode(file_get_contents('./plugin/xn_ad/conf.json'));
$pconf['installed'] == 0 and message(-1, '插件已经卸载。');
$user = user_token_get('', 'bbs');
$user['gid'] != 1 and message(-1, jump('需要管理员权限才能完成卸载。', 'user-login.htm'));
// 第一处卸载
plugin_unstall_before('./pc/view/thread.htm', '<?php echo $first[\'message\']; ?>', file_get_contents('./plugin/xn_ad/ad_1.htm'));
// 第二处卸载
plugin_install_remove('./pc/view/footer_debug.inc.htm', file_get_contents('./plugin/xn_ad/ad_2.htm'));
json_conf_set('installed', 0, './plugin/xn_ad/conf.json');
message(0, '卸载完成!');
示例15: weixinpay
public function weixinpay()
{
$commonUtil = new CommonUtil();
$wxPayHelper = new WxPayHelper();
$source = Input::safeHtml($_POST['source']);
//接收来源属性
$custom_id = intval($_POST['custom_id']);
//接收客户id
$order_id = intval($_POST['trade_no']);
//接收订单id
$merchant_url = Input::safeHtml($_POST['merchant_url']);
//操作中断返回地址
//获取商城id
$shop_id = $_GET['shop_id'];
//获取商品名称
$shop_name = M(C('DB_WECHAT_NAME') . '.wxh_order_detail')->where("is_del = 0 and order_id = '" . $order_id . "' and source = '" . $source . "'")->getField('commodity_name');
//echo M()->getLastSql();
//dump($shop_name);
// echo '<br >access_token为:'.$wxPayHelper->access_token(false);
//获取订单信息
$order_info = M(C('DB_WECHAT_NAME') . '.wxh_order')->where('is_del = 0 and status = 5 and id = ' . $order_id . ' and user_id = ' . $_SESSION['U_IF']['member_id'])->field('from_id, price, add_time')->find();
//$price = $order_info['price'];
//验证post参数,非法返回
if ($source == '' || $custom_id <= 0 || $order_id <= 0 || $merchant_url == '') {
die(jump(array('jumpmsg' => '参数非法')));
}
//获取订单编号 :来源+订单ID+客户ID+用户ID
$order_no = $source . '_' . $order_id . '_' . $custom_id . '_' . $_SESSION['U_IF']['member_id'];
//echo $order_no;
//$wxpay_config = C('WX_PAY_CONFIG');
//dump($wxpay_config);
//echo $total_fee = round($price,2); //付款金额
//获取银行通道类型
$wxPayHelper->setParameter("bank_type", "WX");
//商品描述
$wxPayHelper->setParameter("body", $shop_name);
//商户号
$wxPayHelper->setParameter("partner", $wxPayHelper->getPartnerId());
//商户订单号
$wxPayHelper->setParameter("out_trade_no", $order_no);
//订单总金额
$wxPayHelper->setParameter("total_fee", '1');
//支付币种
$wxPayHelper->setParameter("fee_type", "1");
//通知url
$wxPayHelper->setParameter("notify_url", "http://test.weixinhai.net/shop.php/Wxpay/payNotifyUrl/shop_id/" . $shop_id);
//订单生成的机器IP
$wxPayHelper->setParameter("spbill_create_ip", get_client_ip());
//字符编码
$wxPayHelper->setParameter("input_charset", "UTF-8");
//生成jsapi支付请求json
//dump($wxPayHelper->parameters);
$data = array('merchant_url' => $merchant_url, 'custom_id' => $custom_id, 'shop_name' => $shop_name, 'order_info' => $order_info);
$msg = $wxPayHelper->create_biz_package();
$this->assign('merchant_url', $merchant_url);
$this->assign('custom_id', $custom_id);
$this->assign('data', $data);
$this->assign('msg', $msg);
$this->display('./shop/Tpl/Index/weixinpay.html');
//dump($msg);
}