本文整理匯總了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);
}