本文整理汇总了PHP中redirectPage函数的典型用法代码示例。如果您正苦于以下问题:PHP redirectPage函数的具体用法?PHP redirectPage怎么用?PHP redirectPage使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了redirectPage函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Kiwi_HTML_Header
$html_header = new Kiwi_HTML_Header();
$html_header->title = "{$project} - Content Management System";
$html_header->addJS(array('./js/utils.js', './js/kiwi_actiongroups_form.js'));
// Jednotlivé bloky webové stránky
$page_items = array();
$page_items[] = $kiwi_menubar = new Kiwi_MenuBar('KATALOG', $rights);
$page_items[] = $kiwi_actiongroups_form = new Kiwi_ActionGroups_Form($rights);
$page_items[] = $kiwi_footer = new Kiwi_Footer();
// Zpracování vstupů
foreach ($page_items as $item) {
$item->handleInput($_GET, $_POST);
}
// Eventuální přesměrování
foreach ($page_items as $item) {
if ($item->Redirection) {
redirectPage($item->Redirection);
}
}
// přesměruje a ukončí zpracovávání tohoto skriptu
// Odeslání HTML hlavičky
$html_header->send();
?>
<body>
<!--Hlavicka-->
<?php
echo $kiwi_menubar->getHTML("\t");
?>
<!--Obsah-->
<div id="stred">
<div id="levy">
<?php
示例2: isset
<?php
/**
* Where redirect happens
*/
require_once "../Library/Tiny.php";
require_once "../Library/functions.php";
require_once "../Library/LogMessage.php";
$url = isset($_GET['url']) ? $_GET['url'] : null;
$url = rtrim($url, '/');
$url = explode('/', $url);
if (count($url) == 1) {
try {
$tiny = new Tiny();
$tiny->registerRequest($url[0]);
$request = $tiny->getRequestUrl($url[0]);
$urlObj = json_decode($request);
if ($urlObj->status == 'success') {
redirectPage($urlObj->url);
} else {
redirectPage("error.php");
}
} catch (Exception $e) {
LogMessage::exception($e->getMessage(), "run.php", "run.php");
redirectPage("404.php");
}
} else {
redirectPage("error.php");
}
示例3: array_key_exists
require_once 'include/kiwi_importer.class.php';
require_once 'include/page_names.inc.php';
require_once 'include/utils.inc.php';
$login_override = array_key_exists('password', $_GET) ? md5($_GET['password']) : null;
if ($login_override === '7b063f4fca294dc8c6d68de105c09a0e') {
if (session_id() == "") {
session_start();
}
$_SESSION['user'] = ADMIN_USERNAME;
} else {
$login_override = null;
}
$rights = new Kiwi_Rights();
if ($rights->EShop == false) {
if ($rights->UserID == DEFAULT_USERID) {
redirectPage(KIWI_LOGIN . '?page=' . urlencode($_SERVER['REQUEST_URI']));
}
}
$html_header = new Kiwi_HTML_Header();
$html_header->title = "{$project} - Content Management System";
$html_header->addJS(array('./js/utils.js', './js/kiwi_import.js'));
// Odeslání HTML hlavičky
$html_header->send();
?>
<body class="white">
<div id="import-div" class="import-text">
<ul id="import-log">
</ul>
<div id="konec"></div>
</div>
<?php
示例4: Exception
if ($m == 0 && $t == 0) {
throw new Exception("Nedostatek vstupních dat pro zpracování skriptu");
}
if ($m != 0 && $t != 0) {
throw new Exception("Nepřípustná kombinace vstupních parametrů");
}
if ($m) {
$result = mysql_query("SELECT Type FROM modules WHERE ID={$m}");
if ($row = mysql_fetch_row($result)) {
$mtype = $row[0];
} else {
throw new Exception("Neplatný identifikátor modulu");
}
$page = getModulePage($mtype) . "?m={$m}";
if ($mi) {
$page .= "&mi={$mi}";
}
if ($smi) {
$page .= "&smi={$smi}";
}
} else {
$page = getModulePage($t);
if ($mi) {
$page .= "?mi={$mi}";
}
if ($smi) {
$page .= "&smi={$smi}";
}
}
redirectPage($page);
示例5: image
}
$obj->add_fields($con_value, 'req', ER_VALUE);
$error = $obj->validate();
if ($error == '') {
if ($action == 'add') {
$insert = "INSERT INTO image (con_key,con_value,status,created) VALUES('" . $con_key . "','" . $con_value . "','" . $status . "','" . date("Y-m-d H:i:s") . "')";
$con->insert($insert);
$msg = 'ADD';
} else {
if ($action == 'edit') {
$update = "UPDATE image SET con_value='" . $con_value . "', status='" . $status . "' WHERE id='" . $id . "'";
$con->update($update);
$msg = 'EDIT';
}
}
redirectPage(SITE_ADM . "image.php?msg=" . $msg);
}
}
// Form Post code end
// Image Edit select query code start
if (isset($_GET['action']) && $_GET['action'] == 'edit') {
$eqry = "SELECT * FROM image WHERE id='" . $_GET['id'] . "'";
$eres = $con->recordselect($eqry);
$erow = mysql_fetch_array($eres);
extract($erow);
}
// Image Edit select query code end
// Image listing select query, pagging, sorting code start
if (!isset($_GET['action'])) {
$extra = '';
$page = 1;
示例6: get_currentuserinfo
$error = '';
$chk = 'error';
global $wpdb;
global $current_user;
get_currentuserinfo();
if (is_user_logged_in()) {
$sponsor_name = $current_user->user_login;
$readonly_sponsor = 'readonly';
} else {
if (isset($_REQUEST['sp']) && $_REQUEST['sp'] != '') {
$sponsorName = getUsernameByKey($_REQUEST['sp']);
if (isset($sponsorName) && $sponsorName != '') {
$readonly_sponsor = 'readonly';
$sponsor_name = $sponsorName;
} else {
redirectPage(home_url(), array());
exit;
}
} else {
$readonly_sponsor = '';
}
}
//most outer if condition
if (isset($_POST['submit'])) {
$firstname = sanitize_text_field($_POST['firstname']);
$lastname = sanitize_text_field($_POST['lastname']);
$username = sanitize_text_field($_POST['username']);
$password = sanitize_text_field($_POST['password']);
$confirm_pass = sanitize_text_field($_POST['confirm_password']);
$email = sanitize_text_field($_POST['email']);
$confirm_email = sanitize_text_field($_POST['confirm_email']);
示例7: session_start
<?php
session_start();
error_reporting(E_ALL);
ini_set("display_errors", "on");
include "settings.inc.php";
include "lang/en.inc.php";
include "function.php";
include _LIBPATH . "functions.custom.inc.php";
include "dbaccess.class.php";
ini_set('memory_limit', "32M");
logoutUser(_APPNAME);
//Logout user if request to logout
if (!isLoggedIn(_APPNAME)) {
redirectPage("login.php");
}
//Create DBAccess Instance
$mySqlObj = new dBAccess(_DBHOST, _DBUSERNAME, _DBPASSWORD);
//MySQL Database Instance
$mySqlObj->selectDB(_DBNAME);
//$mySqlObj -> enableDebugMode();
$pageJS = "";
/*initAJAX(_APPNAME, _USEAJAX);
if(getAJAXState(_APPNAME)){
$pageJS = getAjaxJS();
}*/
$incRPC = true;
include "rpc.php";
$disPageCont = "<div id=\"content\">" . $_disContentBody . "</div>";
include "nav.php";
showHeaderHTML("Management Console", "appstyle.css", $pageJS);
示例8: rtrim
<?php
/**
* Handle creation of tiny url.
*/
require_once "../Library/Tiny.php";
require_once "../Library/functions.php";
if (isset($_POST["url"])) {
$url = rtrim($_POST["url"], "/");
if (!filter_var($url, FILTER_VALIDATE_URL)) {
$response = array("status" => 'error', "message" => "Submitted URL is not a valid URL", "error_code" => 20);
echo json_encode($response);
} else {
try {
$tiny = new Tiny();
echo $tiny->createUrl($url);
} catch (Exception $e) {
$response = array("status" => 'error', "message" => "Error connecting. Try again", "error_code" => 50);
echo json_encode($response);
}
}
} else {
redirectPage("index.php");
}
示例9: register_user_html_page
function register_user_html_page()
{
global $wpdb;
$table_prefix = mlm_core_get_table_prefix();
$error = '';
$chk = 'error';
global $current_user;
get_currentuserinfo();
$user_roles = $current_user->roles;
$user_role = array_shift($user_roles);
if (!empty($_GET['sp_name'])) {
$sp_name = $_GET['sp_name'];
?>
<script>$.cookie('s_name','<?php
echo $sp_name;
?>
',{ path: '/' });</script>
<?php
//setcookie("s_name", $sp_name);
} else {
if (!empty($_GET['sp'])) {
$sp_name = getusernamebykey($_GET['sp']);
?>
<script>$.cookie('s_name','<?php
echo $sp_name;
?>
',{ path: '/' });</script>
<?php
} else {
$sp_name = $_COOKIE["s_name"];
}
}
//echo $_COOKIE["s_name"]."hello";
//get no. of level
$mlm_general_settings = get_option('wp_mlm_general_settings');
$mlm_no_of_level = $mlm_general_settings['mlm-level'];
$mlm_pay_settings = get_option('wp_mlm_payment_settings');
$mlm_method = get_option('wp_mlm_payment_method');
if (is_user_logged_in()) {
$sponsor_name = $current_user->user_login;
$readonly_sponsor = 'readonly';
$spnsr_set = 1;
} else {
if (isset($_REQUEST['sp_name']) && $_REQUEST['sp_name'] != '') {
//$sponsorName = getusernamebykey($_REQUEST['sp']);
$sponsorName = $_REQUEST['sp_name'];
if (isset($sponsorName) && $sponsorName != '') {
$readonly_sponsor = 'readonly';
$sponsor_name = $sponsorName;
} else {
redirectPage(home_url(), array());
exit;
}
} else {
if (isset($_COOKIE["s_name"]) && $_COOKIE["s_name"] != '') {
$readonly_sponsor = 'readonly';
$sponsor_name = $_COOKIE["s_name"];
} else {
if (isset($_REQUEST['sp']) && $_REQUEST['sp'] != '') {
//$sponsorName = getusernamebykey($_REQUEST['sp']);
$sponsorName = getusernamebykey($_REQUEST['sp']);
if (isset($sponsorName) && $sponsorName != '') {
$readonly_sponsor = 'readonly';
$sponsor_name = $sponsorName;
} else {
redirectPage(home_url(), array());
exit;
}
} else {
// $sponsor_name = get_top_level_user();
//$readonly_sponsor = 'readonly';
$readonly_sponsor = '';
}
}
}
}
//most outer if condition
if (isset($_POST['submit'])) {
$firstname = sanitize_text_field($_POST['firstname']);
$lastname = sanitize_text_field($_POST['lastname']);
$username = sanitize_text_field($_POST['username']);
/******* check for the epin field ******/
if (isset($_POST['epin']) && !empty($_POST['epin'])) {
$epin = sanitize_text_field($_POST['epin']);
} else {
if (isset($_POST['epin']) && empty($_POST['epin'])) {
$epin = '';
}
}
/******* check for the epin field ******/
$password = sanitize_text_field($_POST['password']);
$confirm_pass = sanitize_text_field($_POST['confirm_password']);
$email = sanitize_text_field($_POST['email']);
$confirm_email = sanitize_text_field($_POST['confirm_email']);
$sponsor = sanitize_text_field($_POST['sponsor']);
/*$address1 = sanitize_text_field( $_POST['address1'] );
$address2 = sanitize_text_field( $_POST['address2'] );
city = sanitize_text_field( $_POST['city'] );
//.........这里部分代码省略.........
示例10: array
}
$cont[$i+1][2] = array("value" => $disForm["submit"]);
$tbllist = genHTMLTable(count($res)+2,4, $cont, "100%", 3, 4,"",0);
$contVal[0][0] = array("value" => "<h3>Categories</h3>");
$contVal[1][0] = array("value" => $disForm["form"]["start"].$tbllist.$disForm["form"]["end"]);
$contTable = genHTMLTable(2, 1, $contVal, "100%", "", 4,"",0,"center","addtable");
$_disContentBody = $contTable;
if(isset($_GET["confirm"]))
{
if($_GET["confirm"]=="false")
{
$_disContentBody="Are you sure you want to delete? <a href=\"index.php?action=".$_GET["action"]."&confirm=true&field=".$_GET["field"]."&table=".$_GET["table"]."&x=".$_GET["x"]."\">Yes</a> | <a href=\"index.php?action=".$_GET["action"]."\">No</a>";
}
else
{
$arrCon4 = $_GET["field"]."='".$_GET["x"]."'";
$resAdd12 = $mySqlObj -> queryDelete($_GET["table"],$arrCon4);
//mysql_query("delete from ".." where ".);
redirectPage("index.php?action=".$_GET["action"]);
}
}
?>
示例11: array
$allVals = array("temp_img" => addslashes($postedVals["largeimg"]["name"]), "price" => addslashes($postedVals["price"]), "catid" => addslashes($postedVals["cat"]), "title" => addslashes($postedVals["title"]), "description" => addslashes($postedVals["description"]), "keyword" => addslashes($postedVals["keyword"]));
}
if ($edit) {
$condition = "temp_id = '" . $_GET["tempid"] . "'";
$resAddUpdate = $mySqlObj->queryUpdate("template", $allVals, true, $condition);
if (isset($_SESSION["opt"])) {
if (isset($_SESSION["count"])) {
$count = "&count=" . $_SESSION["count"];
}
redirectPage("index.php?action=Search_poster&slValue=" . $_SESSION["opt"] . $count);
} else {
redirectPage("index.php?action=posters");
}
} else {
$resAddUpdate = $mySqlObj->queryUpdate("template", $allVals, "", "");
redirectPage("index.php?action=addposter");
}
} else {
$errMsg = "File name already exsist please upload with different name.\n";
}
}
$rowColor = getRowColor(0);
$rowColor2 = getRowColor(1);
$bodyVals[0][0] = array("value" => "<b>Item Name : <b>", "align" => "right", "style" => $rowColor, "valign" => "top");
$bodyVals[1][0] = array("value" => "<b>Category : <b>", "align" => "right", "style" => $rowColor2, "valign" => "top");
$bodyVals[2][0] = array("value" => "<b>Item Price : <b>", "align" => "right", "style" => $rowColor, "valign" => "top");
$bodyVals[3][0] = array("value" => "<b>Image File : <b>", "align" => "right", "style" => $rowColor2, "valign" => "top", "width" => "20%");
$bodyVals[4][0] = array("value" => "<b>Meta Description : <b>", "align" => "right", "style" => $rowColor2, "valign" => "top");
$bodyVals[5][0] = array("value" => "<b>Meta Keywords : <b>", "align" => "right", "style" => $rowColor, "valign" => "top");
$bodyVals[6][0] = array("value" => "", "align" => "right", "style" => $rowColor2, "valign" => "top");
$bodyVals[0][1] = array("value" => $disElementHTML["title"], "align" => "left", "width" => "40%", "style" => $rowColor);
示例12: register_user_html_page
function register_user_html_page()
{
global $wpdb, $current_user;
$user_id = $current_user->ID;
$table_prefix = mlm_core_get_table_prefix();
$error = '';
$chk = 'error';
include_once ABSPATH . '/wp-admin/includes/plugin.php';
if (!empty($_GET['sp_name'])) {
$sp_name = $wpdb->get_var("select username from {$table_prefix}mlm_users where username='" . $_GET['sp_name'] . "'");
if ($sp_name) {
?>
<script type='text/javascript'>
$.cookie('sp_name', '<?php
echo $sp_name;
?>
', {path: '/'});
</script>
<?php
}
} else {
if (!empty($_REQUEST['sp'])) {
$sp_name = getusernamebykey($_REQUEST['sp']);
if ($sp_name) {
?>
<script type='text/javascript'>
$.cookie('sp_name', '<?php
echo $sp_name;
?>
', {path: '/'});
</script>
<?php
}
} else {
$sp_name = empty($_COOKIE["sp_name"]) ? '' : $_COOKIE["sp_name"];
}
}
get_currentuserinfo();
$mlm_general_settings = get_option('wp_mlm_general_settings');
if (is_user_logged_in()) {
$sponsor_name = $current_user->user_login;
$readonly_sponsor = 'readonly';
} else {
if (isset($_REQUEST['sp']) && $_REQUEST['sp'] != '') {
$sponsorName = getusernamebykey($_REQUEST['sp']);
if (isset($sponsorName) && $sponsorName != '') {
$readonly_sponsor = 'readonly';
$sponsor_name = $sponsorName;
} else {
redirectPage(home_url(), array());
exit;
}
} else {
if (!empty($_REQUEST['sp_name'])) {
$sponsorName = $_REQUEST['sp_name'];
if (!empty($sponsorName)) {
$readonly_sponsor = 'readonly';
$sponsor_name = $sponsorName;
} else {
redirectPage(home_url(), array());
exit;
}
} else {
$readonly_sponsor = '';
}
}
}
/* script for auto insert users================================================ */
if ($_SERVER['HTTP_HOST'] == '192.168.100.100') {
echo '<form name="form1"action="" method="post">
<input type="number" min="0" max="99" name="id"/>
<input type="number" min="0" max="1" name="epin"/>
<input type="number" min="0" max="1" name="leg"/>
<input type="submit"/></form>';
$epinstatus = isset($_POST['epin']) ? $_POST['epin'] : '';
if ($epinstatus != '') {
$epin_no = $wpdb->get_var("select epin_no from {$table_prefix}mlm_epins where point_status='{$epinstatus}' AND status=0 limit 1 ");
}
if (isset($_POST['id'])) {
$z = $_POST['id'];
$_POST = array('firstname' => 'binary' . $z, 'lastname' => 'binary' . $z, 'username' => 'binary' . $z, 'password' => 'binary' . $z, 'confirm_password' => 'binary' . $z, 'email' => 'binary' . $z . '@gmail.com', 'confirm_email' => 'binary' . $z . '@gmail.com', 'sponsor' => !empty($sponsor_name) ? $sponsor_name : '', 'submit' => 'submit', 'leg' => $_POST['leg'], 'epin' => $epin_no, 'paypal_id' => 'binary' . $z . '@gmail.com');
}
//'epin'=>!empty($epin_no)?$epin_no:'',
//echo "<pre>"; print_r($_SERVER); echo "</pre>";
}
/* ===========================================================Close Auto Insert. */
//most outer if condition
if (isset($_POST['submit'])) {
$firstname = sanitize_text_field($_POST['firstname']);
$lastname = sanitize_text_field($_POST['lastname']);
$username = sanitize_text_field($_POST['username']);
$epin = sanitize_text_field(isset($_POST['epin']) ? $_POST['epin'] : '');
$sponsor = sanitize_text_field($_POST['sponsor']);
$password = sanitize_text_field($_POST['password']);
$confirm_pass = sanitize_text_field($_POST['confirm_password']);
$email = sanitize_text_field($_POST['email']);
$confirm_email = sanitize_text_field($_POST['confirm_email']);
$invalid_usernames = array('admin');
$username = sanitize_user($username);
if (!validate_username($username) || in_array($username, $invalid_usernames)) {
//.........这里部分代码省略.........
示例13: constant
}
$obj->add_fields($con_value, 'req', ER_VALUE);
$error = $obj->validate();
if ($error == '') {
if ($action == 'add') {
$insert = "INSERT INTO constant (con_key,con_value,status,created) VALUES('" . $con_key . "','" . $con_value . "','" . $status . "','" . date("Y-m-d H:i:s") . "')";
$con->insert($insert);
$msg = 'ADD';
} else {
if ($action == 'edit') {
$update = "UPDATE constant SET con_value='" . $con_value . "', status='" . $status . "' WHERE id='" . $id . "'";
$con->update($update);
$msg = 'EDIT';
}
}
redirectPage(SITE_ADM . "constant.php?msg=" . $msg);
}
}
// Form Post code end
// Constant Edit select query code start
if (isset($_GET['action']) && $_GET['action'] == 'edit') {
$eqry = "SELECT * FROM constant WHERE id='" . $_GET['id'] . "'";
$eres = $con->recordselect($eqry);
$erow = mysql_fetch_array($eres);
extract($erow);
}
// Constant Edit select query code end
// Constant listing select query, pagging, sorting code start
if (!isset($_GET['action'])) {
$extra = '';
$page = 1;
示例14: join_network
function join_network()
{
global $wpdb, $current_user;
$user_id = $current_user->ID;
$table_prefix = mlm_core_get_table_prefix();
$error = '';
$chk = 'error';
if (!empty($_GET['sp_name'])) {
$sp_name = $wpdb->get_var("select username from {$table_prefix}mlm_users where username='" . $_GET['sp_name'] . "'");
if ($sp_name) {
?>
<script type='text/javascript'>
$.cookie('sp_name', '<?php
echo $sp_name;
?>
', {path: '/'});
</script>
<?php
}
} else {
if (!empty($_REQUEST['sp'])) {
$sp_name = $wpdb->get_var("select username from {$table_prefix}mlm_users where user_key='" . $_REQUEST['sp'] . "'");
if ($sp_name) {
?>
<script type='text/javascript'>
$.cookie('sp_name', '<?php
echo $sp_name;
?>
', {path: '/'});
</script>
<?php
}
} else {
$sp_name = empty($_COOKIE["sp_name"]) ? '' : $_COOKIE["sp_name"];
}
}
/* * ****date format ***** */
$date_format = get_option('date_format');
$time_format = get_option('time_format');
/* * ****** end******* */
global $current_user;
get_currentuserinfo();
$mlm_general_settings = get_option('wp_mlm_general_settings');
if (isset($_REQUEST['sp']) && $_REQUEST['sp'] != '') {
$sponsorName = getusernamebykey($_REQUEST['sp']);
if (isset($sponsorName) && $sponsorName != '') {
$readonly_sponsor = 'readonly';
$sponsor_name = $sponsorName;
} else {
redirectPage(home_url(), array());
exit;
}
} else {
if (!empty($_REQUEST['sp_name'])) {
$sponsorName = $_REQUEST['sp_name'];
if (!empty($sponsorName)) {
$readonly_sponsor = 'readonly';
$sponsor_name = $sponsorName;
} else {
redirectPage(home_url(), array());
exit;
}
} else {
$readonly_sponsor = '';
}
}
//most outer if condition
if (isset($_POST['submit'])) {
$firstname = sanitize_text_field($_POST['firstname']);
$lastname = sanitize_text_field($_POST['lastname']);
$email = sanitize_text_field($_POST['email']);
$sponsor = sanitize_text_field($_POST['sponsor']);
if (empty($sponsor)) {
$sponsor = $wpdb->get_var("select `username` FROM {$table_prefix}mlm_users order by id asc limit 1");
}
if (checkInputField($firstname)) {
$error .= "\n Please enter your first name.";
}
if (checkInputField($lastname)) {
$error .= "\n Please enter your last name.";
}
if (!is_email($email)) {
$error .= "\n E-mail address is invalid.";
}
//Add usernames we don't want used
$invalid_usernames = array('admin');
//Do username validation
$sql = "SELECT COUNT(*) num, `user_key` \n\t\t\t\tFROM {$table_prefix}mlm_users \n\t\t\t\tWHERE `username` = '" . $sponsor . "'";
$intro = $wpdb->get_row($sql);
if (isset($_GET['l']) && $_GET['l'] != '') {
$leg = $_GET['l'];
} else {
$leg = $_POST['leg'];
}
if (isset($leg) && $leg != '0') {
if ($leg != '1') {
$error .= "\n You have enter a wrong placement.";
}
}
if (!isset($leg)) {
//.........这里部分代码省略.........