本文整理汇总了PHP中HEADER函数的典型用法代码示例。如果您正苦于以下问题:PHP HEADER函数的具体用法?PHP HEADER怎么用?PHP HEADER使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了HEADER函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: send_file
function send_file($name)
{
OB_END_CLEAN();
$path = $name;
//"../temp/".$name;
if (!IS_FILE($path) or CONNECTION_STATUS() != 0) {
return FALSE;
}
HEADER("Cache-Control: no-store, no-cache, must-revalidate");
HEADER("Cache-Control: post-check=0, pre-check=0", FALSE);
HEADER("Pragma: no-cache");
HEADER("Expires: " . GMDATE("D, d M Y H:i:s", MKTIME(DATE("H") + 2, DATE("i"), DATE("s"), DATE("m"), DATE("d"), DATE("Y"))) . " GMT");
HEADER("Last-Modified: " . GMDATE("D, d M Y H:i:s") . " GMT");
HEADER("Content-Type: application/octet-stream");
HEADER("Content-Length: " . (string) FILESIZE($path));
HEADER("Content-Disposition: inline; filename={$name}");
HEADER("Content-Transfer-Encoding: binary\n");
if ($file = FOPEN($path, 'rb')) {
while (!FEOF($file) and CONNECTION_STATUS() == 0) {
print FREAD($file, 1024 * 8);
FLUSH();
}
FCLOSE($file);
}
return CONNECTION_STATUS() == 0 and !CONNECTION_ABORTED();
}
示例2: connecte
/**
* gère la connection d'un utilisateur, détermine si le mot de passe est bon
* @return message confirmant ou infirmant la connexion si le mot de passe est invalide
*/
function connecte()
{
$mes = "";
$row = SelectMultiple("if_utilisateur", "login", $this->login, " AND pwd='" . easy($this->pwd, "e") . "' AND actif='o'");
if ($row["iduti"]) {
$this->id = $row["iduti"];
$icnx = time() + 36000;
$cnx = (string) $icnx;
$cnx = $cnx . "-" . $this->id;
$ip = getenv("REMOTE_ADDR");
mysql_query("INSERT INTO if_acces (iduti,cnx,tps,ip,inactif) VALUES ('{$this->id}','{$cnx}',now(),'{$ip}','n')");
$this->cnx = $cnx;
//Quel menu afficher lorsqu'on se logue ?
$larub = new Menu();
$larub->afficheRub();
mysql_close();
HEADER("Location: ../index.php?id={$this->id}&cnx={$this->cnx}&pg_admin=accueil&numrub={$larub->nummenu}");
} else {
$mes = "Votre identifiant et/ou votre mot de passe n\\'est pas valide !";
}
return $mes;
}
示例3: HEADER
<?php
//This page is only redirection to login.php you can do anything on this page as per your needs.
HEADER('LOCATION: login.php');
示例4: session_start
<?php
session_start();
include_once "./expiring_session.php";
if (empty($_SESSION['login']) && empty($_SESSION['pwd'])) {
HEADER("location:./login.php?target=bid");
}
if (empty($_GET['id'])) {
HEADER("location:./bidlist.php");
}
#acces BD en PDO
include_once "params.inc.php";
try {
// Data Source Name
$dsn = 'mysql:host=' . $host . '; port=3306; dbname=' . $dbname;
// instanciation
$conn = new PDO($dsn, $user, $password);
// ici on est connecté …
} catch (PDOException $e) {
die("Erreur : " . $e->getMessage());
}
include_once "./params.inc.php";
$link = mysqli_connect($host, $user, $password, $dbname);
if (!$link) {
die("Erreur de Connexion(" . mysqli_connect_errno() . ') ' . mysqli_connect_error());
} else {
$req = "SELECT `id_vendeur` FROM `projet-objet` WHERE `id_objet` = " . $_GET['id'];
$result = mysqli_query($link, $req);
$donnees = mysqli_fetch_row($result);
$id_vnd = $donnees[0];
}
示例5: set_option
set_option('facebook_login', $_POST['facebook_login']);
} else {
set_option('facebook_login', '0');
}
if (isset($_POST['disable_login'])) {
set_option('disable_login', $_POST['disable_login']);
} else {
set_option('disable_login', '0');
}
if (isset($_POST['disable_registration'])) {
set_option('disable_registration', $_POST['disable_registration']);
} else {
set_option('disable_registration', '0');
}
$message = $language['settings_saved1'];
HEADER('LOCATION: general_settings.php?message=' . $message);
}
}
}
//form validations
}
//form processing.
//Page display settings.
$page_title = $language['general_setting_page_title'];
//You can edit this to change your page title.
$sub_title = "Manage everything related to website features.";
require_once "Includes/header.php";
//including header file.
//display message if exist.
if (isset($_GET['message']) && $_GET['message'] != '') {
echo '<div class="alert alert-success">';
示例6: session_id
require_once "conf.php";
require_once "session.inc";
$pricewatch = session_id();
if ($pricewatch == "") {
HEADER("Location: " . link_s("index.php"));
}
if ($asin_fehler == '1') {
$asin = $link_asin;
session_register("asin");
HEADER("Location: " . link_s("produkte_neu2.php"));
exit;
}
if ($link_asin != "") {
if ($asin = asin_search($link_asin)) {
session_register("asin");
HEADER("Location: " . link_s("produkte_neu2.php"));
exit;
} else {
$asin_fehler = 1;
}
}
session_unregister("asin");
$text = $head;
$text .= $body;
$text .= menu("");
$text .= main();
$text .= $foot;
echo gzipoutput($text);
// ===========================================================================
function main()
{
示例7: session_id
<?php
require_once "conf.php";
require_once "session.inc";
$pricewatch = session_id();
error_reporting(0);
if ($pricewatch == "") {
HEADER("Location: " . link_s("index.php"));
}
session_unregister("asin");
$lk = connect();
$produkte_db = mysql_db_query($mysql_db, "SELECT NAME, ASIN, KATEGORIE, BILD_KLEIN FROM `pricewatch_produkte` WHERE ID =" . $user[ID] . " ORDER BY `KATEGORIE` ASC, `NAME` ASC", $lk);
mysql_close($lk);
$text = $head;
$text .= $body;
$text .= menu("produkte");
$text .= main();
$text .= $foot;
echo gzipoutput($text);
// ===========================================================================
function main()
{
global $name, $produkte_db;
$str = "<table width='400' align='center' class='rand'>";
$str .= "<tr><td class='ueberschrift'>Überwachte Artikel</td></tr>";
$str .= "<tr><td>";
$str .= "<p align='justify'>Auf dieser Seite finden sie eine Überischt aller von {$name} für sie überwachten Produkte. Um sich ein Produkt bei Amazon.de anzusehen klicken sie einfach auf das entsprechende Bild.<br>Alle rot markierten Produkte sind im moment billiger oder gleich teuer wie der von ihnen festgesezte \"Erinnerungs-Preis\".</p></td></tr>";
$str .= "</table>";
$str .= "<br><br>";
$str .= "<table width='400' align='center' class='rand'>";
$str .= "<tr><td align='center'><a href='" . link_s("produkte_neu.php") . "'>Neuen Artikel hinzufügen</a></td></tr>";
示例8: switch
<?php
switch ($target) {
case "home":
HEADER('location:./home.php');
break;
case "login":
HEADER('location:./login.php');
break;
case "signup":
HEADER('location:./signup.php');
break;
case "newbid":
HEADER('location:./newbid.php');
break;
case "bidlist":
HEADER('location:./bidlist.php');
break;
case "profil":
HEADER('location:./profil.php');
break;
case "bid":
HEADER('location:./bidlist.php');
break;
default:
HEADER('location:./index.php');
break;
}
示例9: mysql_query
<?php
include "connect.php";
if (isset($_GET['seat'])) {
$deleted = $_GET['seat'];
$sql = mysql_query("DELETE FROM `bus` WHERE `b_id`='{$deleted}'");
echo "success";
HEADER('location:admin.php');
exit;
}
?>
开发者ID:OkkayChing,项目名称:Design-and-Development-of-Online-Bus-Ticket-Reservations-System,代码行数:11,代码来源:delete.php
示例10: session_start
<?php
session_start();
include_once "./expiring_session.php";
if ($_SESSION['login'] == NULL && $_SESSION['pwd'] == NULL) {
HEADER("location:./login.php?target=newbid");
}
//acces BD en PDO
include_once "./params.inc.php";
?>
<html>
<head>
<?php
include_once "./head.html";
?>
<title>Nouvelle Annonce</title>
</head>
<body>
<?php
$page_actuel = "login";
include "./header.php";
?>
<div class="structure">
<div id="body">
<section>
<article class="centre">
<h1>Nouvelle Annonce</h1>
示例11: mysqli_query
<?php
include 'session.php';
echo $_POST['name'];
echo $_POST['description'];
echo $_POST['task_category'];
echo $_POST['id'];
$manager = $_POST['manager'];
$query = "UPDATE tasks SET name = '" . $_POST['name'] . "', description = '" . $_POST['description'] . "', task_category = '" . $_POST['task_category'] . "' WHERE id= '" . $_POST['id'] . "';";
mysqli_query($dbc, $query);
HEADER('Location: eventTable.php?managerType=' . $manager . '');
示例12: getArrayVal
}
return $str;
}
function getArrayVal(array $array, $name)
{
if (array_key_exists($name, $array)) {
return strip_only_tags($array[$name], "script");
}
}
error_reporting(0);
$pic = getArrayVal($_GET, "pic");
$height = getArrayVal($_GET, "height");
$width = getArrayVal($_GET, "width");
include CL_ROOT . "/include/class.hft_image.php";
$imagehw = GetImageSize($pic);
$imagewidth = $imagehw[0];
$imageheight = $imagehw[1];
$myThumb = new hft_image(CL_ROOT . "/" . $pic);
$myThumb->jpeg_quality = 80;
if (!isset($height)) {
$ratio = $imageheight / $imagewidth;
$height = $width * $ratio;
$height = round($height);
}
if (!isset($width)) {
$ratio = $imagewidth / $imageheight;
$width = $height * $ratio;
}
$myThumb->resize($width, $height, 0);
HEADER("Content-Type: image/jpeg");
$myThumb->output_resized("");
示例13: session_destroy
<?php
include 'system_load.php';
//Including this file we load system.
/*
Logout function if called.
*/
if (isset($_GET['logout']) && $_GET['logout'] == 1) {
session_destroy();
HEADER('LOCATION: ' . get_option('redirect_on_logout'));
exit;
}
//Logout done.
//user Authentication.
authenticate_user('admin');
$page_title = $language['dashboard_title'];
//You can edit this to change your page title.
$sub_title = "Welcome admin here you can manage everything.";
require_once "Includes/header.php";
//including header file.
?>
<!--Small Widget Starts Here-->
<div class="col-sm-3">
<div class="dash-widget dash-counter" data-count=".num" data-from="0" data-to="99.9" data-suffix="%" data-duration="2">
<div class="dash-icon">
<i class="glyphicon glyphicon-user"></i>
</div>
<div class="dash-label">
<strong class="num"><?php
$new_user->get_total_users('all');
示例14: get_option
} else {
if (get_option('language') != '') {
$lang = get_option('language');
} else {
$lang = 'english';
}
}
include 'language/' . $lang . '.php';
include 'classes/users.php';
include 'classes/userlevel.php';
include 'classes/notes.php';
include 'classes/messages.php';
include 'classes/announcements.php';
if (isset($_SESSION['user_id'])) {
$check_user = new Users();
$user_status = $check_user->get_user_info($_SESSION['user_id'], 'status');
if ($user_status == 'ban' || $user_status == 'deactivate' || $user_status == 'suspend') {
session_destroy();
HEADER('LOCATION: index.php');
}
$message_obj = new Messages();
$new_level = new Userlevel();
$notes_obj = new Notes();
$announcement_obj = new Announcements();
$new_user = new Users();
if ($new_user->get_user_info($_SESSION['user_id'], 'profile_image') == '') {
$profile_img = 'images/thumb.png';
} else {
$profile_img = $new_user->get_user_info($_SESSION['user_id'], 'profile_image');
}
}
示例15: __construct
/**
* Constructor function
* @todo Document more please.
*/
public function __construct()
{
parent::__construct();
HEADER("Access-Control-Allow-Origin: *");
// Start the timer for how long the request takes
$this->_start_rtime = microtime(TRUE);
// init objects
$this->request = new stdClass();
$this->response = new stdClass();
$this->rest = new stdClass();
$this->_zlib_oc = @ini_get('zlib.output_compression');
// Lets grab the config and get ready to party
$this->load->config('rest');
// let's learn about the request
$this->request = new stdClass();
// Check to see if this IP is Blacklisted
if ($this->config->item('rest_ip_blacklist_enabled')) {
$this->_check_blacklist_auth();
}
// Is it over SSL?
$this->request->ssl = $this->_detect_ssl();
// How is this request being made? POST, DELETE, GET, PUT?
$this->request->method = $this->_detect_method();
// Create argument container, if nonexistent
if (!isset($this->{'_' . $this->request->method . '_args'})) {
$this->{'_' . $this->request->method . '_args'} = array();
}
// Set up our GET variables
$this->_get_args = array_merge($this->_get_args, $this->uri->ruri_to_assoc());
// This library is bundled with REST_Controller 2.5+, but will eventually be part of CodeIgniter itself
$this->load->library('format');
// Try to find a format for the request (means we have a request body)
$this->request->format = $this->_detect_input_format();
// Some Methods cant have a body
$this->request->body = NULL;
$this->{'_parse_' . $this->request->method}();
// Now we know all about our request, let's try and parse the body if it exists
if ($this->request->format and $this->request->body) {
$this->request->body = $this->format->factory($this->request->body, $this->request->format)->to_array();
// Assign payload arguments to proper method container
$this->{'_' . $this->request->method . '_args'} = $this->request->body;
}
// Merge both for one mega-args variable
$this->_args = array_merge($this->_get_args, $this->_options_args, $this->_patch_args, $this->_head_args, $this->_put_args, $this->_post_args, $this->_delete_args, $this->{'_' . $this->request->method . '_args'});
// Which format should the data be returned in?
$this->response = new stdClass();
$this->response->format = $this->_detect_output_format();
// Which format should the data be returned in?
$this->response->lang = $this->_detect_lang();
// Developers can extend this class and add a check in here
$this->early_checks();
// Check if there is a specific auth type for the current class/method
$this->auth_override = $this->_auth_override_check();
// When there is no specific override for the current class/method, use the default auth value set in the config
if ($this->auth_override !== TRUE) {
if (strtolower($this->config->item('rest_auth')) == 'basic') {
$this->_prepare_basic_auth();
} elseif (strtolower($this->config->item('rest_auth')) == 'digest') {
$this->_prepare_digest_auth();
} elseif ($this->config->item('rest_ip_whitelist_enabled')) {
$this->_check_whitelist_auth();
}
}
$this->rest = new StdClass();
// Load DB if its enabled
if (config_item('rest_database_group') and (config_item('rest_enable_keys') or config_item('rest_enable_logging'))) {
$this->rest->db = $this->load->database(config_item('rest_database_group'), TRUE);
} elseif (property_exists($this, "db")) {
$this->rest->db = $this->db;
}
// Checking for keys? GET TO WORK!
if (config_item('rest_enable_keys')) {
$this->_allow = $this->_detect_api_key();
}
// only allow ajax requests
if (!$this->input->is_ajax_request() and config_item('rest_ajax_only')) {
$this->response(array('status' => false, 'error' => 'Only AJAX requests are accepted.'), 505);
}
}