本文整理汇总了PHP中Utility::Redirect方法的典型用法代码示例。如果您正苦于以下问题:PHP Utility::Redirect方法的具体用法?PHP Utility::Redirect怎么用?PHP Utility::Redirect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Utility
的用法示例。
在下文中一共展示了Utility::Redirect方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: excute
public function excute()
{
$post = RequestParam::Post();
if ($post) {
$username = $post['username'];
$pwd = $post['pwd'];
$result = Lib_User::Register($username, $pwd);
if ($result) {
System::AddNotice("注册成功");
Utility::Redirect("/demo/list");
}
}
$param = array('username' => $username);
$this->show($param);
}
示例2: Show
public static function Show($template = '', $parameters = array(), $assignGlobal = true)
{
$smarty = self::GetTemplate();
$smarty->php_handling = Smarty::PHP_ALLOW;
if ($assignGlobal) {
$smarty = self::AssignGlobalVar($smarty);
}
if ($parameters) {
foreach ($parameters as $key => $val) {
$smarty->assign($key, $val);
}
}
if (!$template) {
$webroot = Config::Get('webroot');
$path = $_SERVER['PHP_SELF'];
if (trim($webroot, '/')) {
$webroot = strtr($webroot, array('/' => "\\/", "\\" => "\\/"));
$path = preg_replace("/{$webroot}/", '', $path, 1);
}
$path = trim($path, '/');
$dotPos = strpos($path, '.');
if ($dotPos !== false) {
$path = substr($path, 0, $dotPos);
}
$template = $path . self::DEFAULT_TEMPLATE_SUFFIX;
}
///验证文件是否存在
//404
if (strpos($template, '/') !== 0) {
$file = TEMPLATE_PATH . '/' . $template;
} else {
$file = $template;
}
if (!file_exists($file)) {
//找不到文件 报404
$systemConfig = Config::Get('system');
if ($systemConfig['404_redirect']) {
Utility::Redirect('/' . $systemConfig['error']);
} else {
$template = $systemConfig['404'];
}
}
///
$smarty->display($template);
}
示例3: excute
public function excute()
{
$loginUser = Lib_User::GetLoginUser();
if ($loginUser) {
Utility::Redirect("/demo/list");
}
$post = RequestParam::Post();
if ($post) {
$username = $post['username'];
$pwd = $post['pwd'];
$loginUser = Lib_User::Login($username, $pwd);
if ($loginUser) {
System::AddNotice("登陆成功");
Utility::Redirect("/demo/list");
}
}
$param = array();
$this->show($param);
}
示例4: dirname
<?php
require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
need_manager();
need_auth('market');
if ($_POST) {
$table = new Table('partner', $_POST);
$table->SetStrip('location', 'other');
$table->create_time = time();
$table->user_id = $login_user_id;
$table->password = ZPartner::GenPassword($table->password);
$table->group_id = abs(intval($table->group_id));
$table->city_id = abs(intval($table->city_id));
$table->open = strtoupper($table->open) == 'Y' ? 'Y' : 'N';
$table->display = strtoupper($table->display) == 'Y' ? 'Y' : 'N';
$table->image = upload_image('upload_image', null, 'team', true);
$table->image1 = upload_image('upload_image1', null, 'team');
$table->image2 = upload_image('upload_image2', null, 'team');
$table->insert(array('username', 'user_id', 'city_id', 'title', 'group_id', 'bank_name', 'bank_user', 'bank_no', 'create_time', 'location', 'other', 'homepage', 'contact', 'mobile', 'phone', 'password', 'address', 'open', 'display', 'image', 'image1', 'image2', 'longlat'));
$partner = DB::GetTableRow('partner', array('username' => $username, 'password' => $password));
// 更新商户支付信息
if ($login_partner) {
$table = new Table('partner_pay', $_POST);
$table->SetPk('id', $partner['id']);
$insert = array('id', 'tenpaymid', 'tenpaysec', 'alipaymid', 'alipaysec');
$flag = $table->insert($insert);
}
Session::Set('notice', '新建商户成功');
Utility::Redirect(WEB_ROOT . '/manage/partner/index.php');
}
include template('manage_partner_create');
示例5: upload_image
$table->image = upload_image('upload_image', $team['image'], 'team', true);
$table->image1 = upload_image('upload_image1', $team['image1'], 'team');
$table->image2 = upload_image('upload_image2', $team['image2'], 'team');
//team_type == goods
if ($table->team_type == 'goods') {
$table->min_number = 1;
}
$error_tip = array();
if (!$error_tip) {
if ($table->update($insert)) {
print $table->title;
$field = strtoupper($table->conduser) == 'Y' ? null : 'quantity';
$now_number = Table::Count('order', array('team_id' => $table->id, 'state' => 'pay'), $field);
$need_update = array('now_number' => $now_number);
/* 增加了总数,未卖完状态 */
if ($table->max_number > $table->now_number) {
$need_update['close_time'] = 0;
}
Table::UpdateCache('team', $table->id, $need_update);
Session::Set('notice', '团购修改成功');
Utility::Redirect(WEB_ROOT . "/biz/index.php");
} else {
Session::Set('error', '修改团信息失败,请检查系统环境?');
}
}
}
$groups = DB::LimitQuery('category', array('condition' => array('zone' => 'group')));
$groups = Utility::OptionArray($groups, 'id', 'name');
$partners = DB::LimitQuery('partner', array('order' => 'ORDER BY id DESC'));
$partners = Utility::OptionArray($partners, 'id', 'title');
include template('biz_coupon_edit');
示例6: include_once
<?php
include_once( 'config.php' );
//QQ登录成功后的回调地址,主要保存access token
qq_callback();
//获取用户标示id
get_openid();
die($_SESSION["access_token"].'sss'.$_SESSION["openid"]);
if(!option_yes('firstqzonelogin')){
Utility::Redirect( WEB_ROOT . '/thirdpart/qzone/auth.php' );
}
Utility::Redirect(WEB_ROOT . '/account/qzone_bind.php' );
示例7: dirname
<?php
require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
need_manager(true);
$version = strval(SYS_VERSION);
$action = strval($_GET['action']);
if ('db' == $action) {
$r = zuitu_upgrade($action, $version);
Session::Set('notice', '数据库结构升级成功,数据库已经是最新版本');
Utility::Redirect(WEB_ROOT . '/manage/system/upgrade.php');
}
$version_meta = zuitu_version();
$newversion = $version_meta['version'];
$software = $version_meta['software'];
$install = $version_meta['install'];
$patch = $version_meta['patch'];
$patchdesc = $version_meta['patchdesc'];
$upgrade = $version_meta['upgrade'];
$upgradedesc = $version_meta['upgradedesc'];
$isnew = $newversion == $version;
include template('manage_system_upgrade');
示例8: dirname
<?php
require_once dirname(dirname(__FILE__)) . '/app.php';
need_login();
if ($_POST) {
$update = array('email' => $_POST['email'], 'username' => $_POST['username'], 'realname' => $_POST['realname'], 'zipcode' => $_POST['zipcode'], 'address' => $_POST['address'], 'mobile' => $_POST['mobile'], 'gender' => $_POST['gender'], 'city_id' => $_POST['city_id'], 'qq' => $_POST['qq'], 'city_id' => $_POST['city_id']);
$avatar = upload_image('upload_image', $login_user['avatar'], 'user');
$update['avatar'] = $avatar;
if ($_POST['password'] == $_POST['password2'] && $_POST['password']) {
$update['password'] = $_POST['password'];
}
if (ZUser::Modify($login_user['id'], $update)) {
Session::Set('notice', '修改账户设置成功');
Utility::Redirect(WEB_ROOT . '/account/settings.php ');
} else {
Session::Set('error', '修改账户设置失败');
}
}
$readonly['email'] = defined('UC_API') ? '' : 'readonly';
$readonly['username'] = defined('UC_API') ? 'readonly' : '';
include template('account_settings');
示例9: dirname
<?php
require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
need_manager(true);
$pages = array('help_tour' => '玩转' . $INI['system']['abbreviation'], 'help_faqs' => '常见问题', 'help_zuitu' => '什么是' . $INI['system']['abbreviation'], 'help_api' => '开发API', 'about_contact' => '联系方式', 'about_us' => '关于' . $INI['system']['abbreviation'], 'about_job' => '工作机会', 'about_terms' => '用户协议', 'about_privacy' => '隐私声明');
$id = strval($_GET['id']);
if ($id && !in_array($id, array_keys($pages))) {
Utility::Redirect(WEB_ROOT . "/manage/system/page.php");
}
$n = Table::Fetch('page', $id);
if ($_POST) {
$table = new Table('page', $_POST);
$table->SetStrip('value');
if ($n) {
$table->SetPk('id', $id);
$table->update(array('id', 'value'));
} else {
$table->insert(array('id', 'value'));
}
Session::Set('notice', "页面:{$pages[$id]}编辑成功");
Utility::Redirect(WEB_ROOT . "/manage/system/page.php?id={$id}");
}
$value = $n['value'];
include template('manage_system_page');
示例10: template
$locale = $INI['migs']['loc'];
$returnURL = $INI['migs']['url'];
include template('gift_pay');
} else {
Utility::Redirect(WEB_ROOT . '/index.php');
}
}
}
} elseif ($_POST && isset($_POST['cod'])) {
$carray = array('remark' => strtolower($_POST['remark']), 'paytype' => 'cash', 'state' => 'unpay');
Table::UpdateCache('gift_card', $_POST['order_id'], $carray);
$team = Table::Fetch('team', $order['team_id']);
die(include template('gift_pay_success'));
} else {
if (is_post()) {
$order_id = abs(intval($_POST['order_id']));
} else {
$order_id = $id = abs(intval($_GET['id']));
}
if (!$order_id || !($order = Table::Fetch('gift_card', $order_id))) {
die('404 Not Found');
}
if ($order['state'] == 'pay') {
if (is_get()) {
$team = Table::Fetch('team', $order['team_id']);
die(include template('gift_pay_success'));
} else {
Utility::Redirect(WEB_ROOT . "/gift_cards/index.php");
}
}
}
示例11: explode
@(list($_, $order_id, $city_id, $_) = explode('-', $out_trade_no, 4));
if ($verify_result) {
if ($_GET['trade_status'] == 'TRADE_FINISHED' || $_GET['trade_status'] == 'TRADE_SUCCESS') {
$order = Table::Fetch('order', $order_id);
if ($order['state'] == 'unpay') {
//1
$table = new Table('order');
$table->SetPk('id', $order_id);
$table->pay_id = $out_trade_no;
$table->money = $total_fee;
$table->state = 'pay';
$flag = $table->update(array('state', 'pay_id', 'total_fee'));
if ($flag) {
$table = new Table('pay');
$table->id = $out_trade_no;
$table->order_id = $order_id;
$table->money = $total_fee;
$table->currency = 'CNY';
$table->bank = '支付宝';
$table->service = 'alipay';
$table->create_time = time();
$table->insert(array('id', 'order_id', 'money', 'currency', 'service', 'create_time', 'bank'));
//update team,user,order,flow state//
ZTeam::BuyOne($order);
}
}
Utility::Redirect(WEB_ROOT . "/order/pay.php?id={$order_id}");
}
}
Utility::Redirect(WEB_ROOT . "/order/pay.php?id={$order_id}");
示例12: dirname
<?php
require_once dirname(dirname(__FILE__)) . '/app.php';
if ($_POST) {
$login_user = ZUser::GetLogin($_POST['email'], $_POST['password']);
if (!$login_user) {
Session::Set('error', '登录失败');
Utility::Redirect(WEB_ROOT . '/account/login.php');
} else {
if ($INI['system']['emailverify'] && $login_user['enable'] == 'N' && $login_user['secret']) {
Session::Set('unemail', $_POST['email']);
Utility::Redirect(WEB_ROOT . '/account/verify.php');
} else {
Session::Set('user_id', $login_user['id']);
ZLogin::Remember($login_user);
ZUser::SynLogin($_POST['email'], $_POST['password']);
Utility::Redirect(get_loginpage(WEB_ROOT . '/index.php'));
}
}
}
$currefer = strval($_GET['r']);
if ($currefer) {
Session::Set('loginpage', udecode($currefer));
}
include template('account_login');
示例13: dirname
<?php
require_once dirname(dirname(__FILE__)) . '/app.php';
if (is_post()) {
$user = Table::Fetch('user', strval($_POST['email']), 'email');
if ($user) {
$user['recode'] = $user['recode'] ? $user['recode'] : md5(json_encode($user));
Table::UpdateCache('user', $user['id'], array('recode' => $user['recode']));
mail_repass($user);
Session::Set('reemail', $user['email']);
Utility::Redirect(WEB_ROOT . '/account/repass.php?action=ok');
}
Session::Set('error', '你的Email没有在本站注册');
Utility::Redirect(WEB_ROOT . '/account/repass.php');
}
$action = strval($_GET['action']);
if ($action == 'ok') {
die(include template('account_repass_ok'));
}
$pagetitle = '重设密码';
include template('account_repass');
示例14: session_start
<?php
@header('Content-Type:text/html;charset=utf-8');
session_start();
include_once 'config.php';
include_once 'weibooauth.php';
$o = new WeiboOAuth(WB_AKEY, WB_SKEY, $_SESSION['keys']['oauth_token'], $_SESSION['keys']['oauth_token_secret']);
$last_key = $o->getAccessToken($_REQUEST['oauth_verifier']);
//获取ACCESSTOKEN
$_SESSION['last_key'] = $last_key;
if (!option_yes('firstsinalogin')) {
Utility::Redirect(WEB_ROOT . '/thirdpart/sina/auth.php');
}
Utility::Redirect(WEB_ROOT . '/account/sina_bind.php');
示例15: dirname
<?php
require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
need_manager();
$id = abs(intval($_GET['id']));
$team = Table::Fetch('team', $id);
$order = Table::Fetch('order', $id, 'team_id');
if ($order) {
Session::Set('notice', "删除团购({$id})记录失败,存在订单记录");
} else {
Table::Delete('team', $id);
Session::Set('notice', "删除团购({$id})记录成功");
}
Utility::Redirect(udecode($_GET['r']));