本文整理汇总了PHP中Url::redirect_url方法的典型用法代码示例。如果您正苦于以下问题:PHP Url::redirect_url方法的具体用法?PHP Url::redirect_url怎么用?PHP Url::redirect_url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Url
的用法示例。
在下文中一共展示了Url::redirect_url方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Run
static function Run()
{
EClassApi::CheckDir(PAGE_CACHE_DIR);
if (isset($_REQUEST['page']) && $_REQUEST['page'] != '') {
if ($_REQUEST['page'] == "home") {
Url::redirect_url(WEB_DIR, 301);
}
$page_name = strtolower($_REQUEST['page']);
} else {
//echo $_COOKIE['lang'];die();
$page_name = 'home';
}
EClass::$page_cache_file = PAGE_CACHE_DIR . $page_name . '.php';
if (Url::get('refresh_page') == 1) {
self::del_page_cache($page_name);
}
if (Url::get('refresh_page') != 1 && PAGE_CACHE_ON && file_exists(EClass::$page_cache_file)) {
require_once EClass::$page_cache_file;
} else {
$re = DB::query('SELECT id, name, title, layout FROM page WHERE name="' . addslashes($page_name) . '"', __LINE__ . __FILE__);
if ($re) {
EClass::$page = mysql_fetch_assoc($re);
}
if (!EClass::$page) {
Url::redirect_url(WEB_DIR, 301);
}
require_once ROOT_PATH . 'core/EClassGen.php';
EClassGen::PageGenerate();
}
}
示例2: on_submit
function on_submit()
{
if (User::is_admin()) {
$submit = Url::get('submit');
if ($submit == "Cập nhật") {
$title_news = Url::get('title_news');
$news_ids = Url::get('news_ids');
$config_update = array('title' => $title_news, 'news_ids' => implode(',', explode(',', $news_ids)));
###########################
if (isset(CGlobal::$configs['NewsHomeHot'])) {
DB::update('configs', array("conf_val" => addslashes(serialize($config_update))), "conf_key='NewsHomeHot'", __FILE__ . " Dòng:" . __LINE__);
} else {
DB::insert('configs', array("conf_key" => 'NewsHomeHot', "conf_val" => addslashes(serialize($config_update))), __FILE__ . " Dòng:" . __LINE__);
}
AZLib::get_config(0, 1);
}
if (isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER']) {
$referer = $_SERVER['HTTP_REFERER'];
} else {
$referer = $_SERVER['REQUEST_URI'];
}
Url::redirect_url($referer);
}
Url::redirect_url($_SERVER['REQUEST_URI']);
}
示例3: ManageSupport
function ManageSupport($row)
{
Module::Module($row);
if (User::is_admin() || User::have_permit(support_all_perm)) {
CGlobal::$website_title = 'Quản lý thư góp ý của khách hàng';
switch (Url::get('cmd')) {
case 'delete':
DB::query('DELETE FROM support WHERE id=' . EClassApi::getParam('id'));
Url::redirect_url(Url::build_all(array('chk_id', 'del_all', 'cmd', 'id')));
break;
case "edit":
/*case "add":
require_once 'forms/edit.php';
$this->add_form(new EditBadWordForm());
break;*/
/*case "add":
require_once 'forms/edit.php';
$this->add_form(new EditBadWordForm());
break;*/
default:
require_once 'forms/list.php';
$this->add_form(new ManageSupportForm());
break;
}
} else {
Url::access_denied();
}
}
示例4: AdminNews
function AdminNews($row)
{
Module::Module($row);
if (User::is_admin()) {
$cmd = Url::get('cmd');
switch ($cmd) {
case "edit":
case "add_item":
require_once 'forms/detail.php';
$this->add_form(new AdminNewsDetail());
break;
case "delete":
$url = urldecode(Url::get('url'));
$id = Url::get('id');
if (!is_numeric($id)) {
Url::redirect('admin_news_item');
return;
}
DB::delete_id('news_item', $id);
eb_memcache::do_remove('news_item:' . $id);
Url::redirect_url($url);
break;
default:
require_once 'forms/list.php';
$this->add_form(new AdminNewsForm());
break;
}
} else {
Url::access_denied();
}
}
示例5: ManageUserLock
function ManageUserLock($row)
{
CGlobal::$website_title = 'Quản lý thành viên bị khóa';
Module::Module($row);
if (User::have_permit(ADMIN_USER)) {
switch (Url::get('cmd')) {
case 'unban_nick':
$id = (int) Url::get('id', 0);
$user_id = (int) Url::get('user_id', 0);
if ($id) {
DB::update('user', array('block_time' => 0), 'id="' . $user_id . '"');
DB::update('user_lock', array('unlock_time' => TIME_NOW, 'unlock_user' => User::user_name()), 'id = ' . $id);
User::getUser($id, 0, 1);
}
Url::redirect_url(Url::build_all(array('chk_id', 'del_all', 'cmd', 'id', 'lock_die_all', 'hd_ac')));
break;
default:
require_once 'forms/ManageUserLock.php';
$this->add_form(new ListUserLockForm());
break;
}
} else {
Url::access_denied();
}
}
示例6: AdminLogs
function AdminLogs($row)
{
Module::Module($row);
if (User::is_mod() || User::have_permit('logs_all_perm')) {
switch (Url::get('cmd')) {
case 'list_log':
$id = Url::get('id', 0);
if (empty($id)) {
Url::redirect_url('admin_log.html');
exit;
}
require_once 'forms/ListLog.php';
$this->add_form(new ListLogForm());
break;
case 'list_coin':
require_once 'forms/ListCoin.php';
$this->add_form(new ListCoinForm());
break;
case 'extend':
require_once 'forms/Extend.php';
$this->add_form(new ExtendForm());
break;
default:
require_once 'forms/ListLog.php';
$this->add_form(new ListLogForm());
break;
}
} else {
Url::access_denied();
}
}
示例7: check_login
function check_login()
{
if (!User::is_login()) {
AZLib::check_uri();
Url::redirect_url('?page=sign_in&href=' . base64_encode(CGlobal::$query_string));
}
}
示例8: PostItem
function PostItem($row)
{
Module::Module($row);
if (User::is_login()) {
if (!User::have_permit(ADMIN_ITEM) || User::is_block()) {
Url::access_denied();
} else {
if (Url::get('cmd') == 'edit') {
if (Url::get('id')) {
require_once 'forms/EditItemForm.php';
$this->add_form(new EditItemForm());
return;
}
}
if (Url::get('cmd') != '') {
Url::redirect_current();
}
require_once 'forms/PostItemForm.php';
$this->add_form(new PostItemForm());
}
} else {
AZLib::check_uri();
Url::redirect_url('?page=sign_in&href=' . base64_encode(CGlobal::$query_string));
}
}
示例9: draw
function draw()
{
global $display;
if (CGlobal::$curCategory) {
$page_no = (int) Url::get('page_no', 1);
if ($page_no <= 0) {
$page_no = 1;
}
if (User::have_permit(ADMIN_ITEM)) {
$subDir = 'list_item_admin';
} else {
$subDir = 'list_item';
}
//if(StaticCache::notExistCache('c'.CGlobal::$curCategory.'_'.$page_no,30,false,$subDir)){
if (StaticCache::notExistCache('c' . CGlobal::$curCategory . '_' . $page_no, 1, FALSE, $subDir)) {
StaticCache::startCache();
$this->draw_from();
StaticCache::endCache();
}
if (User::have_permit(ADMIN_ITEM)) {
echo '<script>
jQuery(document).ready(function(){
jQuery("div.admin_button").show();
jQuery(".mod_menu").show();
});
function check_permit(catid){
return true;
}
</script>';
}
} else {
Url::redirect_url(WEB_DIR, 301);
}
}
示例10: Run
static function Run()
{
AZLib::CheckDir(PAGE_CACHE_DIR);
if (isset($_REQUEST['page'])) {
if ($_REQUEST['page'] == "home") {
Url::redirect_url(WEB_DIR, 301);
}
$page_name = strtolower($_REQUEST['page']);
} else {
$page_name = 'home';
}
AZNet::$page_cache_file = PAGE_CACHE_DIR . $page_name . '.php';
if (Url::get('refresh_page') == 1) {
self::del_page_cache($page_name);
}
if (Url::get('refresh_page') != 1 && PAGE_CACHE_ON && file_exists(AZNet::$page_cache_file)) {
require_once AZNet::$page_cache_file;
} else {
$re = DB::query('SELECT id, name, title, layout FROM page WHERE name="' . addslashes($page_name) . '"', __LINE__ . __FILE__);
if ($re) {
AZNet::$page = mysql_fetch_assoc($re);
}
if (!AZNet::$page) {
Url::redirect_url(WEB_DIR, 301);
}
AZGen::PageGenerate();
}
}
示例11: AdminBanner
function AdminBanner($row)
{
Module::Module($row);
if (User::is_admin()) {
switch (Url::get('cmd')) {
case 'remove_banner':
$id = Url::get('id', 0);
if (empty($id)) {
Url::redirect_url('admin_banner.html');
exit;
}
Banner::delete_banner($id);
Url::redirect_url('admin_banner.html');
break;
case 'edit_banner':
require_once 'forms/EditBanner.php';
$this->add_form(new EditBannerForm());
break;
case 'list_banner':
require_once 'forms/ListBanner.php';
$this->add_form(new ListBannerForm());
break;
default:
require_once 'forms/ListBanner.php';
$this->add_form(new ListBannerForm());
break;
}
} else {
Url::access_denied();
}
}
示例12: Signin
function Signin($row)
{
Module::Module($row);
switch (Url::get('cmd')) {
case 'check_account':
$this->check_account();
exit;
case 'check_email':
$this->check_email();
exit;
case 'check_security_code':
$this->check_security_code();
exit;
case 'check_email_format':
$this->check_email_format();
exit;
default:
if (!User::is_login()) {
require_once 'forms/signin.php';
$this->add_form(new SigninForm());
} else {
$href = base64_decode(Url::get('href'));
if ($href) {
$href = str_replace('SID=' . $_COOKIE['PHPSESSID'], '', $href);
Url::redirect_url($href);
} else {
Url::redirect();
}
}
break;
}
}
示例13: on_submit
function on_submit()
{
$type = intval(trim(Url::get('type')));
$data = Url::get('data');
if (empty($data['is_active'])) {
$data['is_active'] = 0;
}
if (empty($data['id'])) {
// if (!empty($data['name']) && faq::is_exists('name', $data['name'])) {
// $this->setErrorMessage('admin/faq/error', 'Exists faq with name: ' . $data['name']);
// Url::redirect_url('admin_faq.html?cmd=edit_faq');
// exit();
// }
// if (empty($data['name'])) {
// $this->setErrorMessage('admin/faq/error', 'faq name is null ');
// Url::redirect_url('admin_faq.html?cmd=edit_faq');
// exit();
// }
$data['created'] = TIME_NOW;
$id = Faq::add_faq($data);
} else {
Faq::update_faq($data['id'], $data);
$id = $data['id'];
}
Faq::remove_cache($id);
$add_new = intval(trim(Url::get('add_new', 0)));
if (empty($add_new)) {
Url::redirect_url('admin_faq.html?cmd=edit_faq&id=' . $id);
} else {
Url::redirect_url('admin_faq.html?cmd=edit_faq');
}
exit;
}
示例14: SignIn
function SignIn($row)
{
Module::Module($row);
if (User::is_login()) {
if ($data = Session::get('user_data') and $data['home_page']) {
Url::redirect_url($data['home_page']);
} else {
Url::redirect('home');
}
} else {
// xoa toan bo du lieu dang co truoc khi dang nhap
if (Session::is_set('user_id')) {
$id = Session::get('user_id');
DB::update('account', array('last_online_time' => time()), 'id=\'' . $id . '\'');
setcookie('user_id', "", time() - 3600);
Session::destroy('user_id');
}
//if(URL::get("m")== "mobile"){
// require_once 'forms/mlogin.php';
// $this->add_form(new SignInmForm);
//}else{
require_once 'forms/sign_in.php';
$this->add_form(new SignInForm());
//}
}
}
示例15: draw
function draw()
{
//xoa 1 id
if (Url::get("act") == "del" && Url::get('id')) {
DB::query('DELETE FROM ban_ip WHERE id=' . Url::get('id'));
Url::redirect_url(Url::build_all(array('chk_id', 'del_all', 'act', 'id')));
}
global $display;
//list
$this->beginForm();
$items = array();
$sql = "SELECT * FROM ban_ip Order by id desc";
$result = DB::query($sql);
while ($row = mysql_fetch_assoc($result)) {
$row['create_time'] = date('d/m - h:i', $row['create_time']);
$items[$row['id']] = $row;
$arr_mem_cache[$row['ip']] = $row;
}
// cho mang vao memcache
AZMemcache::do_put('list_ban_ip', $arr_mem_cache);
$display->add('items', $items);
$display->add('items_json', json_encode($items));
$display->output('ManageBanIp');
$this->endForm();
}