<meta http-equiv="refresh" content="秒數;url=網址" />
<script>document.location.href="網址";</script>
header('Location: 網址');
exit;
# ---- 目前網址 ----
$_SESSION['return_url'] = getCurrentUrl();
getCurrentUrl():這是一個函數,用來擷取目前的網址
$_SESSION['return_url']:$_SESSION[] 則是伺服端的全域變數,會一直存在到瀏覽器關閉為止
redirect_header($_SESSION['return_url'], 3, _BP_SUCCESS);
這是我們自訂的函數,用來轉向,並通知使用者執行結果
/*-----------流程區----------*/
switch ($op) {
case "op_update_sort": //更新排序
#強制關除錯
ugm_module_debug_mode(0);
echo op_update_sort();
exit;
case "op_update_enable"://更新狀態
#強制關除錯
ugm_module_debug_mode(0);
echo op_update_enable();
exit;
case "op_delete"://刪除資料
#強制關除錯
ugm_module_debug_mode(0);
echo op_delete();
exit;
//新增資料
case "op_insert":
op_insert();
redirect_header($_SESSION['return_url'], 3, _BP_SUCCESS);
XoopsCache::clear();
exit;
//輸入表單
case "op_form":
op_form($sn);
break;
//預設動作
default:
# ---- 目前網址 ----
$_SESSION['return_url'] = getCurrentUrl();
$op = "op_list";
op_list();
break;
/*---判斷動作請貼在上方---*/
}