本文整理汇总了PHP中headerRedirect函数的典型用法代码示例。如果您正苦于以下问题:PHP headerRedirect函数的具体用法?PHP headerRedirect怎么用?PHP headerRedirect使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了headerRedirect函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: implode
}
if (!empty($_POST['status_send'])) {
$plugin['order_status'][] = 'SENT';
}
if (!empty($_POST['status_back'])) {
$plugin['order_status'][] = 'RETURN';
}
if (!empty($_POST['status_done'])) {
$plugin['order_status'][] = 'COMPLETED';
}
$plugin['order_status'] = implode('-', $plugin['order_status']);
if ($plugin['order_status'] == '') {
$plugin['order_status'] = 'NEW-ORDER';
}
$sql = 'UPDATE ' . DB_PREPEND . "phpwcms_shop_orders SET order_status='" . aporeplace($plugin['order_status']) . "' ";
$sql .= "WHERE order_id=" . intval($_POST['order_status']);
if (_dbQuery($sql, 'UPDATE')) {
set_status_message($BLM['shopprod_status_msg'], 'success');
}
}
$sql = 'SELECT *, UNIX_TIMESTAMP(order_date) AS order_date_unix FROM ' . DB_PREPEND . 'phpwcms_shop_orders ';
$sql .= "WHERE order_id = " . intval($_GET['show']);
$plugin['data'] = _dbQuery($sql);
if (isset($plugin['data'][0])) {
$plugin['data'] = $plugin['data'][0];
$plugin['data']['order_data'] = @unserialize($plugin['data']['order_data']);
} else {
headerRedirect(shop_url('controller=order', ''));
}
$BLM['shopprod_payby_INVOICE'] = $BLM['shopprod_payby_onbill'];
}
示例2: array
$plugin['data']['shopprod_filecaption'] = array();
$plugin['data']['shopprod_url'] = isset($plugin['data']['shopprod_var']['url']) ? $plugin['data']['shopprod_var']['url'] : '';
} else {
headerRedirect(shop_url('controller=prod', ''));
}
}
$sql = 'SELECT C1.cat_id, C1.cat_name, C1.cat_pid, C1.cat_status, ';
$sql .= "IFNULL(CONCAT(C2.cat_name, '>', C1.cat_name), C1.cat_name) AS category ";
$sql .= 'FROM ' . DB_PREPEND . 'phpwcms_categories C1 ';
$sql .= 'LEFT JOIN ' . DB_PREPEND . 'phpwcms_categories C2 ';
$sql .= 'ON C1.cat_pid=C2.cat_id ';
$sql .= "WHERE C1.cat_type='module_shop' AND C1.cat_status!=9 ";
$sql .= 'ORDER BY category';
$plugin['data']['categories'] = _dbQuery($sql);
} elseif ($action == 'status') {
list($plugin['data']['shopprod_id'], $plugin['data']['shopprod_status']) = explode('-', $_GET['status']);
$plugin['data']['shopprod_id'] = intval($plugin['data']['shopprod_id']);
$plugin['data']['shopprod_status'] = empty($plugin['data']['shopprod_status']) ? 1 : 0;
$sql = 'UPDATE ' . DB_PREPEND . 'phpwcms_shop_products SET ';
$sql .= "shopprod_status = " . $plugin['data']['shopprod_status'] . " ";
$sql .= "WHERE shopprod_id = " . $plugin['data']['shopprod_id'];
_dbQuery($sql, 'UPDATE');
headerRedirect(shop_url('controller=prod', ''));
} elseif ($action == 'delete') {
$plugin['data']['shopprod_id'] = intval($_GET['delete']);
$sql = 'UPDATE ' . DB_PREPEND . 'phpwcms_shop_products SET ';
$sql .= "shopprod_status = 9 ";
$sql .= "WHERE shopprod_id = " . $plugin['data']['shopprod_id'];
_dbQuery($sql, 'UPDATE');
headerRedirect(shop_url('controller=prod', ''));
}
示例3: mysql_free_result
mysql_free_result($alias_result);
}
}
//Kategoriebezeichner
$article['cat'] = $content['struct'][$row["article_cid"]]['acat_name'];
//redirection definition
if ($row["article_redirect"]) {
$row["article_redirect"] = str_replace('{SITE}', PHPWCMS_URL, $row["article_redirect"]);
$content["redirect"] = explode(' ', $row["article_redirect"]);
$content["redirect"]["link"] = $content["redirect"][0];
$content["redirect"]["target"] = isset($content["redirect"][1]) ? $content["redirect"][1] : '';
$content["redirect"]["timeout"] = isset($content["redirect"][2]) ? intval($content["redirect"][2]) : 0;
//check how to redirect - new window or self window
if (!$content["redirect"]["target"] || $content["redirect"]["target"] == "_self" || $content["redirect"]["target"] == "_top" || $content["redirect"]["target"] == "_parent") {
// direct redirection in the same window
headerRedirect($content["redirect"]["link"], 301);
} else {
// redirection by using a special <meta><javascript> html head part
$content["redirect"]["code"] = LF . ' <noscript>' . LF;
$content["redirect"]["code"] .= ' <meta http-equiv="refresh" content="' . $content["redirect"]["timeout"] . ';URL=';
$content["redirect"]["code"] .= $content["redirect"]["link"];
$content["redirect"]["code"] .= '" />' . LF . ' </noscript>' . LF;
$content["redirect"]["code"] .= ' <script' . SCRIPT_ATTRIBUTE_TYPE . '>' . LF;
$content["redirect"]["code"] .= ' var redirectWin;' . LF;
if ($content["redirect"]["timeout"]) {
$content["redirect"]["code"] .= ' window.setTimeout(\'window.open("' . $content["redirect"]["link"] . '", redirectWin)\', ';
$content["redirect"]["code"] .= $content["redirect"]["timeout"] * 1000;
$content["redirect"]["code"] .= ');';
} else {
$content["redirect"]["code"] .= ' window.open("' . $content["redirect"]["link"] . '", redirectWin);';
}
示例4: define
if (isset($phpwcms['modules'][$module]['path'])) {
// module default stuff
// load special backend CSS
$BE['HEADER']['module_calendar.css'] = ' <link href="' . $phpwcms['modules'][$module]['dir'] . 'template/backend.calendar.css" rel="stylesheet" type="text/css" />';
// put translation back to have easier access to it - use it as relation
$BLM =& $BL['modules'][$module];
define('MODULE_HREF', 'phpwcms.php?do=modules&module=' . $module);
$glossary = array();
if (isset($_GET['edit'])) {
// handle posts and read data
include_once $phpwcms['modules'][$module]['path'] . 'inc/processing.inc.php';
// edit form
include_once $phpwcms['modules'][$module]['path'] . 'backend.editform.php';
} elseif (isset($_GET['verify'])) {
// active/inactive
$sql = 'UPDATE ' . DB_PREPEND . 'phpwcms_calendar SET ';
$sql .= "calendar_status=" . (intval($_GET['verify']) ? 1 : 0) . " ";
$sql .= "WHERE calendar_id=" . intval($_GET['editid']);
@_dbQuery($sql, 'UPDATE');
headerRedirect(decode_entities(MODULE_HREF));
} elseif (isset($_GET['delete'])) {
// delete
$sql = 'UPDATE ' . DB_PREPEND . 'phpwcms_calendar SET ';
$sql .= "calendar_status=9 WHERE calendar_id=" . intval($_GET['delete']);
@_dbQuery($sql, 'UPDATE');
headerRedirect(decode_entities(MODULE_HREF));
} else {
// listing
include_once $phpwcms['modules'][$module]['path'] . 'backend.listing.php';
}
}
示例5: session_start
* @license http://opensource.org/licenses/GPL-2.0 GNU GPL-2
* @link http://www.phpwcms.de
*
**/
session_start();
$phpwcms = array();
require_once '../../include/config/conf.inc.php';
require_once '../inc_lib/default.inc.php';
require_once PHPWCMS_ROOT . '/include/inc_lib/dbcon.inc.php';
require_once PHPWCMS_ROOT . '/include/inc_lib/general.inc.php';
checkLogin();
require_once PHPWCMS_ROOT . '/include/inc_lib/backend.functions.inc.php';
if ($_SESSION["wcs_user_admin"] == 1) {
list($do, $id) = explode('|', $_GET['do']);
$do = intval($do);
$id = intval($id);
if ($id) {
if ($do === 1) {
_dbUpdate('phpwcms_pagelayout', array('pagelayout_default' => 0, 'pagelayout_trash' => 9), 'pagelayout_id=' . $id);
} elseif ($do === 2) {
$result = _dbUpdate('phpwcms_template', array('template_default' => 0, 'template_trash' => 9), 'template_id=' . $id);
// Update article categories with new default template ID or to 0 if no default template is defined
if ($result) {
$default = _dbGet('phpwcms_template', 'template_id, template_default', 'template_trash=0 AND template_default=1', '', '', 1);
_dbUpdate('phpwcms_articlecat', array('acat_template' => isset($default[0]['template_id']) ? $default[0]['template_id'] : 0), 'acat_trash=0 AND acat_template=' . $id);
}
}
}
}
headerRedirect($_SESSION['REFERER_URL']);
示例6: VALUES
$sql .= 'glossary_created, glossary_changed, glossary_title, glossary_tag, ';
$sql .= 'glossary_keyword, glossary_text, glossary_highlight, glossary_object, glossary_status';
$sql .= ') VALUES (';
$sql .= "'" . aporeplace($glossary['data']['glossary_created']) . "', ";
$sql .= "'" . aporeplace($glossary['data']['glossary_changed']) . "', ";
$sql .= "'" . aporeplace($glossary['data']['glossary_title']) . "', ";
$sql .= "'" . aporeplace($glossary['data']['glossary_tag']) . "', ";
$sql .= "'" . aporeplace($glossary['data']['glossary_keyword']) . "', ";
$sql .= "'" . aporeplace($glossary['data']['glossary_text']) . "', ";
$sql .= aporeplace($glossary['data']['glossary_highlight']) . ', ';
$sql .= "'" . aporeplace(serialize($glossary['data']['glossary_object'])) . "', ";
$sql .= aporeplace($glossary['data']['glossary_status']);
$sql .= ')';
if ($result = @_dbQuery($sql, 'INSERT')) {
if (isset($_POST['save'])) {
headerRedirect(decode_entities(GLOSSARY_HREF));
}
if (!empty($result['INSERT_ID'])) {
$glossary['id'] = $result['INSERT_ID'];
}
} else {
$glossary['error']['update'] = mysql_error();
}
}
}
}
// try to read entry from database
if ($glossary['id'] && !isset($glossary['error'])) {
$sql = 'SELECT * FROM ' . DB_PREPEND . 'phpwcms_glossary WHERE glossary_id=' . $glossary['id'];
$glossary['data'] = _dbQuery($sql);
$glossary['data'] = $glossary['data'][0];
示例7: aporeplace
// check for multiple entries
if ($value['address_count'] > 1) {
$sql = 'SELECT address_id FROM ' . DB_PREPEND . 'phpwcms_address ';
$sql .= "WHERE address_email='" . aporeplace($value['address_email']) . "' ";
$sql .= 'ORDER BY address_verified DESC, address_name DESC LIMIT 1';
$dataID = _dbQuery($sql);
if (!empty($dataID[0]['address_id'])) {
$sql = 'DELETE FROM ' . DB_PREPEND . 'phpwcms_address ';
$sql .= "WHERE address_email='" . aporeplace($value['address_email']) . "' ";
$sql .= "AND address_id != " . intval($dataID[0]['address_id']);
@_dbQuery($sql, 'DELETE');
}
}
}
}
headerRedirect(PHPWCMS_URL . 'phpwcms.php?do=messages&p=4');
}
// delete susbcriber
if (isset($_GET["del"]) && isset($_GET["s"]) && $_GET["del"] == $_GET["s"]) {
_dbQuery("DELETE FROM " . DB_PREPEND . "phpwcms_address WHERE address_id=" . intval($_GET["del"]) . " LIMIT 1", 'DELETE');
}
// change verification
if (isset($_GET["verify"]) && isset($_GET["s"])) {
$sql = "UPDATE " . DB_PREPEND . "phpwcms_address SET address_verified=";
$sql .= intval($_GET["verify"]) ? 1 : 0;
$sql .= " WHERE address_id=" . intval($_GET["s"]) . " LIMIT 1";
_dbQuery($sql, 'UPDATE');
}
echo '<div class="title" style="margin-bottom:10px">' . $BL['be_subnav_msg_subscribers'] . '</div>';
?>
示例8: headerRedirect
if (!empty($data[0]['address_url1'])) {
headerRedirect($data[0]['address_url1']);
}
if (!($page = file_get_contents(PHPWCMS_TEMPLATE . 'inc_default/subscribe.tmpl'))) {
$page = "The email address <strong>{EMAIL}</strong> was verified.";
}
break;
case 'unsubscribe':
$sql = 'DELETE FROM ' . DB_PREPEND . 'phpwcms_address ';
$sql .= "WHERE address_key='" . aporeplace($hash) . "'";
$result = _dbQuery($sql, 'DELETE');
if (!empty($data[0]['address_url2'])) {
headerRedirect($data[0]['address_url2']);
}
if (!($page = file_get_contents(PHPWCMS_TEMPLATE . 'inc_default/unsubscribe.tmpl'))) {
$page = "All Subscriptions for <strong>{EMAIL}</strong> canceled.";
}
break;
}
} else {
headerRedirect(PHPWCMS_URL);
}
} else {
headerRedirect(PHPWCMS_URL);
}
// some replacements
$page = replaceGlobalRT($page);
$page = str_replace('{EMAIL}', $email, $page);
// send non caching page header
headerAvoidPageCaching();
echo $page;
示例9: session_start
* @author Oliver Georgi <og@phpwcms.org>
* @copyright Copyright (c) 2002-2015, Oliver Georgi
* @license http://opensource.org/licenses/GPL-2.0 GNU GPL-2
* @link http://www.phpwcms.de
*
**/
// general wrapper for ajax based queries
session_start();
$phpwcms = array();
require '../../include/config/conf.inc.php';
require '../inc_lib/default.inc.php';
require PHPWCMS_ROOT . '/include/inc_lib/dbcon.inc.php';
require PHPWCMS_ROOT . '/include/inc_lib/general.inc.php';
require PHPWCMS_ROOT . '/include/inc_lib/backend.functions.inc.php';
if (empty($_SESSION["wcs_user"])) {
headerRedirect('', 401);
die('Sorry, access forbidden');
}
if (isset($_POST['action'])) {
$action = isset($_POST['action']) ? $_POST['action'] : false;
$method = isset($_POST['method']) ? $_POST['method'] : 'json';
$value = isset($_POST['value']) ? clean_slweg($_POST['value'], 0, false) : '';
$jquery = false;
} elseif ($_GET['action']) {
$action = isset($_GET['action']) ? $_GET['action'] : false;
$method = isset($_GET['method']) ? $_GET['method'] : 'json';
$value = isset($_GET['value']) ? clean_slweg($_GET['value'], 0, false) : '';
$jquery = true;
}
if (empty($value)) {
$action = 'empty';
示例10: floor
}
}
$basis = floor($value["max_width"] / $grid);
if (!$basis) {
$basis = 1;
}
$value["max_width"] = $basis * $grid;
$basis = floor($value["max_height"] / $grid);
if (!$basis) {
$basis = 1;
}
$value["max_height"] = $basis * $grid;
}
if (($image = get_cached_image($value, false, false)) && !empty($image[0])) {
// Redirect, the "old" way
if (!empty($phpwcms['cmsimage_redirect'])) {
headerRedirect(PHPWCMS_URL . PHPWCMS_IMAGES . $image[0], 301);
}
if (empty($image['type'])) {
$image['type'] = get_mimetype_by_extension(which_ext($image[0]));
}
header('Content-Type: ' . $image['type']);
header('Content-Disposition: inline');
@readfile(PHPWCMS_THUMB . $image[0]);
exit;
}
}
}
}
// uncached transparent GIF
phpwcms_empty_gif();
示例11: explode
//Wenn Benutzer Admin-Rechte hat
//Löschen eines Benutzers
if (isset($_GET["del"])) {
$ui = explode(":", clean_slweg($_GET["del"]));
$user_id = intval($ui[0]);
$user_email = '';
if (isset($ui[1])) {
$user_email = $ui[1];
}
if ($user_id != $_SESSION["wcs_user_id"]) {
$sql = "UPDATE " . DB_PREPEND . "phpwcms_user SET " . "usr_login='" . generic_string(10) . "', " . "usr_pass='" . md5(generic_string(10)) . "', " . "usr_email='', " . "usr_admin=0, " . "usr_aktiv=9 " . "WHERE usr_id=" . $user_id . " AND " . "usr_email=" . _dbEscape($user_email);
if ($result = mysql_query($sql, $db)) {
if (is_valid_email($user_email)) {
@mail($user_email, "your account", "YOUR PHPWCMS ACCOUNT WAS DELETED\n \ncontact the admin if you have any question.\n\nSee you at " . $phpwcms["site"], "From: " . $phpwcms["admin_email"] . "\nReply-To: " . $phpwcms["admin_email"] . "\n");
}
}
}
}
if (isset($_GET["aktiv"])) {
$ui = explode(":", clean_slweg($_GET["aktiv"]));
$user_id = intval($ui[0]);
$user_aktiv = !empty($ui[1]) ? 1 : 0;
if ($user_id != $_SESSION["wcs_user_id"]) {
$sql = "UPDATE " . DB_PREPEND . "phpwcms_user SET usr_aktiv=" . $user_aktiv . " WHERE usr_id=" . $user_id . ";";
mysql_query($sql, $db) or die("error");
}
}
}
//Ende Abarbeiten Aktion
headerRedirect(PHPWCMS_URL . 'phpwcms.php?' . get_token_get_string('csrftoken') . '&do=admin');
示例12: headerRedirect
<?php
// compare against current domain and redirect to correct if neccessary
//check active Domain
if (isset($LEVEL_ID[1]) && $LEVEL_ID[1] == 1 && strpos(PHPWCMS_URL, 'mydomain1.com') === false) {
headerRedirect('http://www.mydomain1.com/' . rel_url(array(), array(), '', 'urlencode'));
} elseif (isset($LEVEL_ID[1]) && $LEVEL_ID[1] == 2 && strpos(PHPWCMS_URL, 'mydomain2.com') === false) {
headerRedirect('http://www.mydomain2.com/' . rel_url(array(), array(), '', 'urlencode'));
}
示例13: time
$sql = "UPDATE " . DB_PREPEND . "phpwcms_forum SET " . $sqla;
$sql .= " WHERE forum_entry=0 AND forum_id=" . $forum["id"];
$sql .= " LIMIT 1";
} else {
$sql = "INSERT INTO " . DB_PREPEND . "phpwcms_forum SET ";
$sql .= "forum_entry='0', ";
$sql .= "forum_uid='" . $_SESSION["wcs_user_id"] . "', ";
$sql .= "forum_created = '" . time() . "', ";
$sql .= $sqla;
}
// update or insert data entry
mysql_query($sql, $db) or die("error while updating or inserting forum data");
if (!$forum["id"]) {
$forum["id"] = mysql_insert_id($db);
}
headerRedirect(PHPWCMS_URL . 'phpwcms.php?' . get_token_get_string('csrftoken') . '&' . build_QueryString('&', 'do=messages', 'p=6', 's=' . $forum["id"]));
}
if ($forum["id"]) {
// read the given subscription datas from db
$sql = "SELECT * FROM " . DB_PREPEND . "phpwcms_forum WHERE forum_id=" . $forum["id"] . " LIMIT 1;";
if ($result = mysql_query($sql, $db)) {
if ($row = mysql_fetch_assoc($result)) {
$forum["id"] = $row["forum_id"];
$forum["title"] = html($row["forum_title"]);
$forum["text"] = html($row["forum_text"]);
}
mysql_free_result($result);
}
}
// show form
?>
示例14: aporeplace
$sql = "UPDATE " . DB_PREPEND . "phpwcms_template SET " . "template_name='" . aporeplace($template["name"]) . "', " . "template_default=" . $template["default"] . ", " . "template_var='" . aporeplace(serialize($template)) . "' " . "WHERE template_id=" . $template["id"];
} else {
// if ID = 0 then show create new template form
$sql = "INSERT INTO " . DB_PREPEND . "phpwcms_template (" . "template_name, template_default, template_var) VALUES ('" . aporeplace($template["name"]) . "', " . $template["default"] . ", '" . aporeplace(serialize($template)) . "')";
}
// update or insert data entry
@mysql_query($sql, $db) or die("error while updating or inserting template datas");
if (empty($template["id"]) || $createcopy == 1) {
$template["id"] = mysql_insert_id($db);
}
//now proof for default template definition
if ($template["default"]) {
mysql_query("UPDATE " . DB_PREPEND . "phpwcms_template SET template_default=0 " . "WHERE template_id != " . $template["id"], $db);
}
update_cache();
headerRedirect(PHPWCMS_URL . 'phpwcms.php?' . get_token_get_string('csrftoken') . '&do=admin&p=11&s=' . $template["id"]);
}
if ($template["id"]) {
// read the given template datas from db
$sql = "SELECT * FROM " . DB_PREPEND . "phpwcms_template WHERE template_id=" . $template["id"] . " LIMIT 1";
if ($result = mysql_query($sql, $db)) {
if ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
unset($template);
$template = unserialize($row["template_var"]);
$template["id"] = $row["template_id"];
$template["default"] = $row["template_default"];
// compatibility for older releases where only
// 1 css file could be stored per template
if (is_string($template['css'])) {
$template['css'] = array($template['css']);
}
示例15: VALUES
$sql .= 'adplace_created, adplace_changed, adplace_status, adplace_title, ';
$sql .= 'adplace_format, adplace_width, adplace_height, adplace_prefix, adplace_suffix';
$sql .= ') VALUES (';
$sql .= "'" . aporeplace($plugin['data']['adplace_created']) . "', ";
$sql .= "'" . aporeplace($plugin['data']['adplace_changed']) . "', ";
$sql .= $plugin['data']['adplace_status'] . ", ";
$sql .= "'" . aporeplace($plugin['data']['adplace_title']) . "', ";
$sql .= $plugin['data']['adplace_format'] . ", ";
$sql .= $plugin['data']['adplace_width'] . ", ";
$sql .= $plugin['data']['adplace_height'] . ", ";
$sql .= "'" . aporeplace($plugin['data']['adplace_prefix']) . "', ";
$sql .= "'" . aporeplace($plugin['data']['adplace_suffix']) . "'";
$sql .= ')';
if (@_dbQuery($sql, 'INSERT')) {
if (isset($_POST['save'])) {
headerRedirect(decode_entities(MODULE_HREF) . '&listadplace=1');
}
} else {
$plugin['error']['update'] = mysql_error();
}
}
}
}
// try to read entry from database
if ($plugin['id'] && !isset($plugin['error'])) {
$sql = 'SELECT * FROM ' . DB_PREPEND . 'phpwcms_ads_place WHERE adplace_id=' . $plugin['id'];
$plugin['data'] = _dbQuery($sql);
$plugin['data'] = $plugin['data'][0];
}
// default values
if (empty($plugin['data'])) {