本文整理汇总了PHP中headers函数的典型用法代码示例。如果您正苦于以下问题:PHP headers函数的具体用法?PHP headers怎么用?PHP headers使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了headers函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: curl_getinfo
$header_size = curl_getinfo($curl, CURLINFO_HEADER_SIZE);
$respheaders = substr($data, 0, $header_size);
$body = substr($data, $header_size);
curl_close($curl);
return $body;
}
function http_proxy_query($url)
{
示例2: ewiki_spage
function ewiki_spage($id, &$data, $action)
{
global $ewiki_spages, $ewiki_plugins, $ewiki_t;
$r = "";
#-- filename from $id
$fn = $ewiki_spages[strtolower($id)];
#-- php file
if (strpos($fn, ".php") || strpos($fn, ".htm")) {
#-- start new ob level
ob_start();
ob_implicit_flush(0);
#-- prepare environment
global $ewiki_id, $ewiki_title, $ewiki_author, $ewiki_ring, $ewiki_t, $ewiki_config, $ewiki_action, $_EWIKI, $ewiki_auth_user, $ewiki_headers, $headers;
$ewiki_headers = array();
$headers =& $ewiki_headers;
#-- execute script
include $fn;
#-- close ob
$r = ob_get_contents();
ob_end_clean();
#-- add headers
if ($ewiki_headers) {
headers(implode("\n", $ewiki_headers));
}
$clean_html = true;
} elseif (EWIKI_SPAGES_BIN && !headers_sent() && preg_match('#\\.(png|gif|jpe?g|zip|tar)#', $fn)) {
$ct = "application/octet-stream";
if (function_exists("mime_content_type")) {
$ct = mime_content_type($fn);
}
header("Content-Type: {$ct}");
header("ETag: ewiki:spages:" . md5($r) . ":0");
header("Last-Modified: " . gmstrftime($ewiki_t["C"]["DATE"], filemtime($fn)));
passthru($r);
} else {
$f = gzopen($fn, "rb");
$r = gzread($f, 256 << 10);
gzclose($f);
#-- render as text/plain, text/x-wiki
if ($r) {
$r = $ewiki_plugins["render"][0]($r);
}
}
#-- strip <html> and <head> parts (if any)
if ($clean_html) {
$r = preg_replace('#^.+<body[^>]*>(.+)</body>.+$#is', '$1', $r);
}
#-- return body (means successfully handled)
return $r;
}
示例3: ewiki_spage
function ewiki_spage($id, $data, $action)
{
global $ewiki_spages, $ewiki_plugins;
$r = "";
#-- filename from $id
$fn = $ewiki_spages[strtolower($id)];
#-- php file
if (strpos($fn, ".php") || strpos($fn, ".htm")) {
#-- start new ob level
ob_start();
ob_implicit_flush(0);
#-- prepare environment
global $ewiki_id, $ewiki_title, $ewiki_author, $ewiki_ring, $ewiki_t, $ewiki_config, $ewiki_action, $_EWIKI, $ewiki_auth_user, $ewiki_headers, $headers;
$ewiki_headers = array();
$headers =& $ewiki_headers;
#-- execute script
include $fn;
#-- close ob
$r = ob_get_contents();
ob_end_clean();
#-- add headers
if ($ewiki_headers) {
headers(implode("\n", $ewiki_headers));
}
} else {
$f = fopen($fn, "rb");
$r = fread($f, 256 << 10);
fclose($f);
$r = $ewiki_plugins["render"][0]($r);
}
#-- strip <html> and <head> parts (if any)
if (($l = strpos(strtolower($r), "<body")) && ($w = strpos(strtolower($r), "</body"))) {
$l = strpos($r, ">", $l + 1) + 1;
$w = $w - $l;
$r = substr($r, $l, $w);
}
#-- return body (means successful handled)
return $r;
}
示例4: enviar
function enviar($metodo, $op)
{
global $conexao;
$emailremetente = check_input($_POST['emailremetente']);
if ($metodo == "Hospedagem") {
$array_domain = array("@oi.com.br", "@gmail.com");
foreach ($array_domain as $elemento) {
$emailsender = str_replace("{$elemento}", "@127.0.0.1", $emailremetente);
}
} else {
if ($metodo == "smtpGmail") {
require_once "pp/class.phpmailer.php";
$emailsender = smtplogin();
}
}
$nomeremetente = check_input($_POST['nomeremetente']);
$assunto = check_input($_POST['assunto']);
$para = array();
$para = explode("\n", check_input($_POST['para']));
$boundary = "XYZ-" . md5(date("dmYis")) . "-ZYX";
$message = "<div style='background-color:#FFF;color:#FFF;font-family:Arial;font-size:10px;'>";
$message .= "--{$boundary}" . PHP_EOL;
//$message .= "Content-Type: text/html; charset='utf-8'" . PHP_EOL;
$message .= "</div>";
$message .= "<div style='clear:both;background-color:#FFF;color:#000;'>" . opcao("{$op}") . "</div>";
//mensagem
$message .= "<div style='clear:both;margin-top:25px;margin-bottom:15px;height:1px;background-color:lightblue;width:100%;'></div>";
/*if (isset($_FILES["anexo"]['name'])){
echo "Serviço indisponível para manuteção - att andre machado</br>";
echo var_dump($_FILES["anexo"]["tmp_name"]);
echo var_dump($_FILES["anexo"]["name"]);
$path = $_FILES["anexo"]['tmp_name'];
$fileType = $_FILES["anexo"]['type'];
$fileName = $_FILES["anexo"]['name'];
$fp = fopen( $path, "rb" ); // abre o arquivo enviado
$anexo = fread( $fp, filesize( $path ) ); // calcula o tamanho
$anexo = chunk_split(base64_encode( $anexo )); // codifica o anexo em base 64
fclose( $fp ); // fecha o arquivo
$message .= "Content-Type: ". $fileType ."; name=\"". $fileName . "\"" . PHP_EOL;
$message .= "Content-Transfer-Encoding: base64" . PHP_EOL;
$message .= "Content-Disposition: attachment; filename=\"". $fileName . "\"" . PHP_EOL;
}*/
$message .= "<div style='color:#FFF;font-size:12px;font-weight:normal;font-family:Arial;'> --{$boundary} </div>" . PHP_EOL;
imprime_headers($para, $nomeremetente, $emailsender, $emailremetente, $assunto);
$x = 1;
foreach ($para as $elemento) {
?>
<div style="color:white;border:1px solid black;padding-left:15px;padding-bottom:0px;background-color:rgba(150,50,50,0.3);font-family:Arial;margin-bottom:5px;font-size:12px;">
<div style="float:left;padding-top:8px;">
<?php
echo "<div class='NUMERO'>{$x}</div>";
echo "<div style='float:left;'>{$elemento}</div>";
$x++;
?>
</div>
<?php
if ($metodo == "Hospedagem") {
$headers = headers($emailsender, $emailremetente, $assunto);
if (mail($elemento, $assunto, $message, implode("\r\n", $headers), "-r" . $emailsender) && disponivel($_SESSION['userid']) > 0) {
ENVIADO($elemento, $metodo, $nomeremetente);
} else {
FALHA($elemento, $metodo, $nomeremetente);
}
} else {
if ($metodo == "smtpGmail") {
smtpmailer($elemento, $emailremetente, $nomeremetente, $assunto, $message, $metodo);
}
}
?>
<div style="clear:both;"></div>
</div>
<?php
}
?>
<div class="imprime_msgSent">Terminou! Veja a mensagem que foi enviada:</div><?php
echo "<div style='font-weight:normal;font-size:12px;font-family:Arial;border:1px solid gray;padding:15px;background-color:#FFF;margin-bottom:5px;'>{$message}</div>";
echo "<div style='font-weight:normal;font-size:12px;font-family:Arial;border:1px solid gray;padding:15px;background-color:rgba(255,255,255,0.5);margin-bottom:5px;color:black;'>" . htmlentities($message) . "</div>";
if (isset($_SESSION['errorsmtp'])) {
echo $_SESSION['errorsmtp'];
unset($_SESSION['errorsmtp']);
}
}
示例5: headers
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<link href="../za-base/za.css" rel="stylesheet" type="text/css" />
<?php
require "../za-base/za-headers.php";
require "post-headerbar.php";
?>
<title><?php
echo $hostname;
?>
Dependency Checker Status</title>
</head>
<body>
<?php
echo headers("post-commit checker", gen_postthirdbar("status"));
?>
<div class="content">
<h1>Status</h1>
<table border="0">
<tr><td>
Checking from:
<?php
echo htmlspecialchars(trim(`{$conftool} -k svnloc`));
?>
<br><br>
<table border="1">
<tr><td>
示例6: session_start
<?php
session_start();
require __DIR__ . '/../function/news-plus.php';
$article['image'] = $_POST['image'];
if (isset($_POST)) {
$article = [];
if (!empty($_POST['header'])) {
$article['header'] = $_POST['header'];
if (!empty($_POST['padding'])) {
$article['padding'] = $_POST['padding'];
if (headers($article)) {
if (padding($article)) {
if (!empty($_FILES)) {
$res = image($_FILES);
if (false !== $res) {
$article['image'] = $res;
if (isset($article['header']) && isset($article['padding']) && isset($article['image'])) {
News::article_put($article);
header('Location:http://new/index.php?cntr=Newsed&act=All');
exit;
}
} else {
if (isset($article['header']) && isset($article['padding'])) {
News::article_two_put($article);
header('Location:http://new/index.php?cntr=Newsed&act=All');
exit;
}
}
} else {
$_SESSION['error'] = 'Статья не написана!';
示例7: getcwd
$pwd = getcwd();
}
?>
</table>
<td>
<table style='border: 1px solid' cellspacing=5>
<tr><td colspan=2 align='center'><b>Client information</b>
<tr><td><b>Client's IP</b> <td><a href="javascript:alert('Host: <?php
echo gethostbyname($_SERVER['REMOTE_ADDR']);
?>
');"><?php
echo $_SERVER['REMOTE_ADDR'];
?>
</a>
<tr><td><b>Client's browser</b> <td><a href="javascript: alert('HTTP Headers:\n\n<?php
echo headers();
?>
');"><?php
echo htmlspecialchars($_SERVER['HTTP_USER_AGENT']);
?>
</a>
</table>
</table>
<p>
<?php
//---------------------------------
// Parse parameters. Initializing.
//---------------------------------
// Register globals
if (ini_get('register_globals') != '1') {
if (!empty($HTTP_POST_VARS)) {
示例8: headers
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<link href="../za-base/za.css" rel="stylesheet" type="text/css" />
<?php
require "../za-base/za-headers.php";
require "mm-headerbar.php";
require "/net/nova-builder.palm.com/var/www/za-animals.php";
?>
<title><?php
echo $hostname;
?>
Dependency Checkers</title>
</head>
<body>
<?php
echo headers("machine matrix", gen_mmthirdbar("dependency checkers"));
?>
<br />
<div class="content">
<h1>Current Status</h1>
<table border="1">
<thead>
<tr>
<th>name</th>
<th>OS</th>
<th>repository</th>
<th>branch</th>
<th>targets</th>
示例9: output_css
/**
* @param string $css_dir
*/
function output_css($css_dir)
{
$files = headers(array('css_dir' => $css_dir, 'color_scheme' => filter_input(INPUT_GET, 'color', FILTER_SANITIZE_STRING), 'cache_seconds' => filter_input(INPUT_GET, 'cache', FILTER_SANITIZE_NUMBER_INT)));
body($files);
}
示例10: headers
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<link href="../za-base/za.css" rel="stylesheet" type="text/css" />
<?php
require "../za-base/za-headers.php";
require "pre-headerbar.php";
?>
<title><?php
echo $hostname;
?>
Submission Checker Configs</title>
</head>
<body>
<?php
echo headers("submission checker", gen_prethirdbar("configs"));
?>
<div class="content">
<h1>Configs <?php
echo file_exists("FAILING") ? "<font color=\"red\"><b>FAILING!</b></font>" : "";
?>
</h1>
<table border="0">
<tr><td>
Checking against:
<?php
echo "\"" . $svnloc . "/" . $bomloc . "\"";
?>
示例11: headers
<?php
//Admin authentication page
include_once '../helpers.php';
headers("Chit passing system - admin login");
echo "<h1>Login Admin</h1>";
$conn = connect();
//if($conn == null)
// echo "Unable to connect";
//else
// echo "Connection established";
?>
<form method="POST" action="auth.php">
Username:<input type="text" name="uname" /><br/>
Password:<input type="password" name="pwd" /><br/>
<input type="submit" />
</form>
<?php
footers();
示例12: headers
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<link href="../za-base/za.css" rel="stylesheet" type="text/css" />
<?php
require "../za-base/za-headers.php";
require "mm-headerbar.php";
require "/net/nova-builder.palm.com/var/www/za-animals.php";
?>
<title><?php
echo $hostname;
?>
Submission Checkers</title>
</head>
<body>
<?php
echo headers("machine matrix", gen_mmthirdbar("submission checkers"));
?>
<br />
<div class="content">
<h1>Current Status</h1>
<table border="1">
<thead>
<tr>
<th>name</th>
<th>OS</th>
<th>repository</th>
<th>branch</th>
<th>configures</th>
示例13: session_start
<?php
//Home page of the admin
include_once '../helpers.php';
session_start();
if (!$_SESSION["admin"]) {
header("Location: ../denied.php");
exit;
}
headers("Welcome-chit passing Admin");
?>
<h1>Welcome admin</h1>
<a href="logout.php">Logout</a><br/>
<div id="send">
Select council <br/>
<select name="council" id="council">
<option value="disec">UNGA-DISEC</option>
<option value="sc">Security Council</option>
<option value="hrc">HRC</option>
<option value="eu">European Union</option>
<option value="iaea">IAEA</option>
</select><br/>
First Name: <input type="text" id="name" /> <br/>
Country: <input type="text" id="country" /><br/>
MUN ID: <input type="text" id="munid" /><br/>
<button type="submit" onclick="process()" >Add</button>
</div>
<div id="users"></div>
示例14: ob_start
//
//--------------------------------------------------------------------------------------------------
if (Config::get('IndividualStructures', 'cache')['obGzhandler'] && substr_count(server('acceptEncoding'), 'gzip')) {
ob_start('ob_gzhandler');
} else {
ob_start();
}
//--------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------
// Headers
//--------------------------------------------------------------------------------------------------
//
// Başlık bilgileri düzenleniyor.
//
//--------------------------------------------------------------------------------------------------
headers(Config::get('General', 'headers'));
//--------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------
// Set Error Handler
//--------------------------------------------------------------------------------------------------
//
// Yakanalan hata set ediliyor.
//
//--------------------------------------------------------------------------------------------------
if (PROJECT_MODE !== 'publication') {
set_error_handler('Exceptions::table');
}
//--------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------
// INI Ayarlarını Yapılandırma İşlemi
//--------------------------------------------------------------------------------------------------
示例15: mostrar_curso
<?headers("Profesores", "../../");?>
<body>
<div id="wrap">
<div id="header">
<table border="0" width="800">
<tr>
<td width="50%">
<h1><a href="#"><?php
echo $titulo_izq;
?>
</a></h1>
</td>
<td align="right" width="33%">
<h1><a href="#"><?php
echo mostrar_curso($titulo_der);
?>
</a> </h1>
</td>
<td align="right">
<img src="<?php
echo $path;
?>
/logo_chico.png">
</td>
</tr>
</table>
</div>
<div id="intro">
<table>
<tr>