本文整理汇总了PHP中HeaderRedirect函数的典型用法代码示例。如果您正苦于以下问题:PHP HeaderRedirect函数的具体用法?PHP HeaderRedirect怎么用?PHP HeaderRedirect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了HeaderRedirect函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Reload_Chart
function Reload_Chart($name)
{
if (!$name) {
if (isset($_SESSION['webcharts'])) {
return true;
} else {
HeaderRedirect("webreport");
}
}
$arr = getChartArray($name);
if (!count($arr)) {
HeaderRedirect("webreport");
}
if (!$arr["table_type"]) {
if ($arr["db_based"]) {
$arr["table_type"] = "db";
} else {
$arr["table_type"] = "project";
}
}
$_SESSION['webcharts'] = $arr;
$_SESSION["webobject"]["table_type"] = $_SESSION['webcharts']["table_type"];
$_SESSION["webobject"]["name"] = $_SESSION['webcharts']['settings']['name'];
}
示例2: readRecord
/**
* Check whether the user is allowed to see the page
*/
protected function readRecord()
{
if ($this->getCurrentRecordInternal()) {
return true;
}
if ($this->mode == VIEW_SIMPLE) {
HeaderRedirect($this->pSet->getShortTableName(), "list", "a=return");
exit;
}
// nothing to show.
// TODO: add some report or message
exit;
return false;
}
示例3: prgRedirect
/**
* POST-REDIRECT-GET
* Redirect after saving the data to avoid saving again on refresh.
*/
protected function prgRedirect()
{
if (!$this->insertedSuccessfully || $this->mode != ADD_SIMPLE || !no_output_done()) {
return false;
}
// saving message
$_SESSION["message_add"] = $this->message ? $this->message : "";
// redirect
HeaderRedirect($this->pSet->getShortTableName(), $this->pageType);
// turned on output buffering, so we need to stop script
return true;
}
示例4: rulePRG
/**
* PRG rule, to avoid POSTDATA resend
* call after save
*/
function rulePRG()
{
if (no_output_done() && postvalue("a") == "save") {
// redirect, add a=return param for saving SESSION
HeaderRedirect($this->shortTableName, $this->getPageType(), "a=return");
// turned on output buffering, so we need to stop script
exit;
}
}
示例5: HeaderRedirect
<?php
@ini_set("display_errors", "1");
@ini_set("display_startup_errors", "1");
require_once "include/dbcommon.php";
if (!isLogged()) {
HeaderRedirect("login");
return;
}
if ($_SESSION["MyURL"] == "" || !isLoggedAsGuest()) {
Security::saveRedirectURL();
}
$layout = new TLayout("menu", "CityBlueWave", "MobileBlueWave");
$layout->version = 2;
$layout->blocks["top"] = array();
$layout->containers["menu"] = array();
$layout->container_properties["menu"] = array();
$layout->containers["menu"][] = array("name" => "login_menu", "block" => "loggedas_block", "substyle" => 1);
$layout->containers["menu"][] = array("name" => "vmenu", "block" => "menu_block", "substyle" => 1);
$layout->skins["menu"] = "menu";
$layout->blocks["top"][] = "menu";
$page_layouts["menu"] = $layout;
$layout->skinsparams = array();
$layout->skinsparams["empty"] = array("button" => "button1");
$layout->skinsparams["menu"] = array("button" => "button1");
$layout->skinsparams["hmenu"] = array("button" => "button1");
$layout->skinsparams["undermenu"] = array("button" => "button1");
$layout->skinsparams["fields"] = array("button" => "button1");
$layout->skinsparams["form"] = array("button" => "button1");
$layout->skinsparams["1"] = array("button" => "button1");
$layout->skinsparams["2"] = array("button" => "button1");
示例6: add_nocache_headers
require_once "include/dbcommon.php";
add_nocache_headers();
require_once "include/CompanyMaster_variables.php";
require_once "classes/searchcontrol.php";
require_once "classes/advancedsearchcontrol.php";
require_once "classes/panelsearchcontrol.php";
require_once "classes/searchclause.php";
if (!isLogged()) {
Security::saveRedirectURL();
redirectToLogin();
}
$cname = postvalue("cname");
$rname = postvalue("rname");
$accessGranted = CheckTablePermissions($strTableName, "S");
if (!$accessGranted) {
HeaderRedirect("menu");
}
$layout = new TLayout("search5", "CityBlueWave", "MobileBlueWave");
$layout->version = 2;
$layout->blocks["top"] = array();
$layout->containers["fields"] = array();
$layout->container_properties["fields"] = array();
$layout->containers["fields"][] = array("name" => "srchheader", "block" => "searchheader", "substyle" => 2);
$layout->containers["fields"][] = array("name" => "srchconditions", "block" => "conditions_block", "substyle" => 1);
$layout->containers["fields"][] = array("name" => "srchfields", "block" => "", "substyle" => 1);
$layout->containers["fields"][] = array("name" => "srchbuttons", "block" => "searchbuttons", "substyle" => 2);
$layout->skins["fields"] = "fields";
$layout->blocks["top"][] = "fields";
$page_layouts["CompanyMaster_search"] = $layout;
$layout->skinsparams = array();
$layout->skinsparams["empty"] = array("button" => "button1");
示例7: rulePRG
/**
* PRG rule, to avoid POSTDATA resend
*/
function rulePRG()
{
if(no_output_done() && count($this->selectedRecs) && !strlen($this->deleteMessage))
{
// redirect, add a=return param for saving SESSION
HeaderRedirect($this->shortTableName, $this->getPageType(), "a=return");
// turned on output buffering, so we need to stop script
exit();
}
}
示例8: SecurityRedirect
function SecurityRedirect($inlineedit)
{
if($inlineedit == EDIT_INLINE)
{
echo printJSON(array("success" => false, "message" => "The record is not editable"));
return;
}
$_SESSION["MyURL"]=$_SERVER["SCRIPT_NAME"]."?".$_SERVER["QUERY_STRING"];
HeaderRedirect("menu", "message=expired");
}
示例9: display
function display($tpl = null)
{
$this->Application = JFactory::getApplication();
// Access the Component-wide default parameters, already overridden with those for the menu item (if applicable):
//$this->cparams = $this->Application->getParams('com_foxcontact');
// Can't use getParams('com_foxcontact') because JRegistry::merge converts StdClass properties to arrays
$this->cparams = $this->Application->getMenu()->getActive()->params;
// Set Meta Description
if ($description = $this->cparams->get('menu-meta_description')) {
$this->document->setDescription($description);
}
// Set Meta Keywords
if ($keywords = $this->cparams->get('menu-meta_keywords')) {
$this->document->setMetadata('keywords', $keywords);
}
// Set robots (index, follow)
if ($robots = $this->cparams->get('robots')) {
$this->document->setMetadata('robots', $robots);
}
$foxDocument = FoxDocument::getInstance();
// User interface stylesheet
$foxDocument->addResource(array("root" => "media", "filename" => "foxcontact", "type" => "css"));
// User selected stylesheet
$stylesheet = $this->cparams->get("css", "bootstrap.css");
// Removes the extension part from the file name
$stylesheet = preg_replace("/\\.[^.\\s]{3,4}\$/", "", $stylesheet);
$foxDocument->addResource(array("root" => "components", "filename" => $stylesheet, "type" => "css"));
$this->MessageBoard = new FoxMessageBoard();
$this->Submitter = new FSubmitter($this->cparams, $this->MessageBoard);
$this->FieldsBuilder = new FieldsBuilder($this->cparams, $this->MessageBoard);
$this->AjaxUploader = new FAjaxUploader($this->cparams, $this->MessageBoard);
$this->FoxCaptcha = new FCaptcha($this->cparams, $this->MessageBoard);
$this->JMessenger = new FJMessenger($this->cparams, $this->MessageBoard, $this->FieldsBuilder);
$this->DatabaseDispatcher = new DatabaseDispatcher($this->cparams, $this->MessageBoard, $this->FieldsBuilder);
$this->Antispam = new FAntispam($this->cparams, $this->MessageBoard, $this->FieldsBuilder);
$this->Newsletter = new FNewsletter($this->cparams, $this->MessageBoard, $this->FieldsBuilder);
$this->AcyMailing = new FAcyMailing($this->cparams, $this->MessageBoard, $this->FieldsBuilder);
$this->JNews = new FJNewsSubscriber($this->cparams, $this->MessageBoard, $this->FieldsBuilder);
$this->AdminMailer = new FAdminMailer($this->cparams, $this->MessageBoard, $this->FieldsBuilder);
$this->SubmitterMailer = new FSubmitterMailer($this->cparams, $this->MessageBoard, $this->FieldsBuilder);
$this->FormText .= $this->FieldsBuilder->Show();
$this->FormText .= $this->AjaxUploader->Show();
$this->FormText .= $this->AcyMailing->Show();
$this->FormText .= $this->JNews->Show();
$this->FormText .= $this->FoxCaptcha->Show();
$this->FormText .= $this->Antispam->Show();
$this->FormText .= $this->Submitter->Show();
switch (0) {
case $this->Submitter->IsValid():
break;
case $this->FieldsBuilder->IsValid():
break;
case $this->AjaxUploader->IsValid():
break;
case $this->FoxCaptcha->IsValid():
break;
case $this->Antispam->IsValid():
break;
case $this->JMessenger->Process():
break;
case $this->DatabaseDispatcher->Process():
break;
case $this->Newsletter->Process():
break;
case $this->AcyMailing->Process():
break;
case $this->JNews->Process():
break;
case $this->AdminMailer->Process():
break;
case $this->SubmitterMailer->Process():
break;
default:
// None of the previous checks are failed
// Avoid to show the Form and the button again
$this->FormText = "";
// Reset the solution of the captcha in the session after read, avoiding further (ab)uses of the same valid session
$jsession = JFactory::getSession();
$namespace = "foxcontact_component_" . $this->Application->cid;
$jsession->clear("captcha_answer", $namespace);
HeaderRedirect($this->cparams);
}
// Display the view
parent::display($tpl);
}
示例10: prgRedirect
/**
* POST-REDIRECT-GET
* Redirect after saving the data to avoid saving again on refresh.
*/
protected function prgRedirect()
{
if (!$this->updatedSuccessfully || $this->mode != EDIT_SIMPLE || !no_output_done()) {
return false;
}
$_SESSION["message_edit"] = $this->message . "";
$keyParams = array();
foreach ($this->keyFields as $i => $k) {
$keyParams[] = "editid" . ($i + 1) . "=" . rawurldecode($this->keys[$k]);
}
HeaderRedirect($this->pSet->getShortTableName(), $this->getPageType(), implode("&", $keyParams));
exit;
return true;
}
示例11: redirectToLogin
/**
* Redirects to login.
* Displays Session expired message if the page was opened from within the project directory.
*
*/
function redirectToLogin()
{
$expired = "";
$url = "http://";
if( $_SERVER["HTTPS"] && $_SERVER["HTTPS"] != "off")
$url = "https://";
$url .= $_SERVER["HTTP_HOST"] . $_SERVER['REQUEST_URI'];
if( isset($_SERVER['HTTP_REFERER']) )
{
if( getDirectoryFromURI( $_SERVER['HTTP_REFERER'] ) == getDirectoryFromURI( $url )
&& getFilenameFromURI( $_SERVER['HTTP_REFERER'] ) != "index.htm"
&& $_SERVER['HTTP_REFERER'] != getDirectoryFromURI( $url ))
$expired = "message=expired";
}
HeaderRedirect("login", "", $expired);
exit();
}
示例12: processListPageSecurity
public static function processListPageSecurity($table)
{
// user has necessary permissions
if (Security::checkPagePermissions($table, "S")) {
return true;
}
$mode = ListPage::readListModeFromRequest();
// check special permissions like lookup mode
if ($mode == LIST_LOOKUP && ListPage::checkLookupPermissions($table)) {
return true;
}
// page can not be displayed. Redirect or return error
// return error if the page is requested by AJAX
if ($mode != LIST_SIMPLE) {
Security::sendPermissionError();
return false;
}
// The user is logged in but lacks necessary permissions
// redirect to List page or Menu.
if (isLogged() && !isLoggedAsGuest()) {
HeaderRedirect("menu");
return false;
}
// Not logged in
// redirect to Login
// Current URL is already saved in session
redirectToLogin();
return false;
}
示例13: display
function display($tpl = null)
{
$this->Application = JFactory::getApplication();
// The following code will access the Component-wide default parameters,
// already overridden with those for the menu item (if applicable):
$this->cparams = $this->Application->getParams('com_foxcontact');
$this->Submitter = new FSubmitter($this->cparams, $this->messages);
$this->FieldsBuilder = new FieldsBuilder($this->cparams, $this->messages);
$this->AjaxUploader = new FAjaxUploader($this->cparams, $this->messages);
$this->Uploader = new FUploader($this->cparams, $this->messages);
$this->FoxCaptcha = new FCaptcha($this->cparams, $this->messages);
$this->JMessenger = new FJMessenger($this->cparams, $this->messages, $this->FieldsBuilder);
$this->Antispam = new FAntispam($this->cparams, $this->messages, $this->FieldsBuilder);
$this->AdminMailer = new FAdminMailer($this->cparams, $this->messages, $this->FieldsBuilder);
$this->SubmitterMailer = new FSubmitterMailer($this->cparams, $this->messages, $this->FieldsBuilder);
// Build $FormText
$this->FormText .= $this->FieldsBuilder->Show();
$this->FormText .= $this->AjaxUploader->Show();
$this->FormText .= $this->FoxCaptcha->Show();
$this->FormText .= $this->Antispam->Show();
// Usually we want the submit button at the bottom
$this->FormText .= $this->Submitter->Show();
switch (0) {
case $this->Submitter->IsValid():
break;
case $this->FieldsBuilder->IsValid():
break;
case $this->AjaxUploader->IsValid():
break;
case $this->Uploader->IsValid():
break;
case $this->FoxCaptcha->IsValid():
break;
case $this->Antispam->IsValid():
break;
// Spam check passed or disabled
// Spam check passed or disabled
case $this->JMessenger->Process():
break;
case $this->AdminMailer->Process():
break;
case $this->SubmitterMailer->Process():
break;
default:
// None of the previous checks are failed
// Avoid to show the Form and the button again
$this->FormText = "";
// Reset captcha solution in the session after read it, avoiding that a fucked lamer
// abuse of the *same session* without request the captcha again, to send tons of email
$jsession = JFactory::getSession();
$fsession = new FSession($jsession->getId(), $this->Application->cid, $this->Application->mid);
$fsession->PurgeValue("captcha_answer");
HeaderRedirect($this->cparams);
}
// Check for errors.
if (count($errors = $this->get('Errors'))) {
JError::raiseError(500, implode('<br />', $errors));
return false;
}
// Display the view
parent::display($tpl);
}
示例14: reloginAndLogoutProcess
static function reloginAndLogoutProcess($permission)
{
global $strTableName;
include_once(getabspath('classes/loginpage.php'));
$loginXt = new Xtempl();
$loginParams = array("pageType" => PAGE_LOGIN);
$loginParams['xt'] = &$loginXt;
$loginParams["tName"]= NOT_TABLE_BASED_TNAME;
$loginParams['needSearchClauseObj'] = false;
$loginPageObject = new LoginPage($loginParams);
$loginPageObject->init();
// login automatically, if username and password are in cookies.
if( !isLogged() || isLoggedAsGuest() )
{
$username = $_COOKIE["username"];
$password = $_COOKIE["password"];
if( $username != "" && $password != "" )
{
$loginPageObject->LogIn($username, $password);
}
}
$url = $_SERVER["SCRIPT_NAME"].(!empty($_SERVER["QUERY_STRING"]) ? "?".$_SERVER["QUERY_STRING"] : '');
if (!postvalue("onFly"))
{
$_SESSION["MyURL"] = $url;
}
if (postvalue("a")=="logout")
{
$_SESSION["MyURL"] = $_SERVER["SCRIPT_NAME"];
if (!CheckTablePermissions($strTableName, $permission) || !isLogged())
{
HeaderRedirect("login", "", "");
exit();
}
if (isLogged() && !isLoggedAsGuest())
{
$loginPageObject->LogoutAndRedirect($url);
}
}
}
示例15: header
<?php
@ini_set("display_errors", "1");
@ini_set("display_startup_errors", "1");
require_once "include/dbcommon.php";
header("Expires: Thu, 01 Jan 1970 00:00:01 GMT");
require_once "classes/charts.php";
require_once getabspath("include/xml.php");
require_once getabspath("classes/searchclause.php");
if (!isLogged()) {
Security::saveRedirectURL();
HeaderRedirect("login", "", "message=expired");
return;
}
$xml = new xml();
$chrt_strXML = "";
if (checkTableName(postvalue("chartname"), titCHART)) {
include_once "include/" . postvalue("chartname") . "_variables.php";
$chrt_strXML = GetChartXML(postvalue("chartname"));
$chrt_array = $xml->xml_to_array($chrt_strXML);
$_SESSION["webobject"]["table_type"] = "project";
$_SESSION["object_sql"] = "";
}
$webchart = false;
if (!$chrt_strXML) {
$sessPrefix = "webchart" . postvalue('cname');
$chrt_strXML = LoadSelectedChart(postvalue('cname'));
$webchart = true;
$chrt_array = $xml->xml_to_array($chrt_strXML);
if (is_wr_project()) {
include_once "include/" . $chrt_array['settings']['short_table_name'] . "_variables.php";