本文整理汇总了PHP中getHeader函数的典型用法代码示例。如果您正苦于以下问题:PHP getHeader函数的具体用法?PHP getHeader怎么用?PHP getHeader使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getHeader函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getHtmlContext
function getHtmlContext($url)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, TRUE);
//表示需要response header
curl_setopt($ch, CURLOPT_NOBODY, FALSE);
//表示需要response body
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_TIMEOUT, 120);
$result = curl_exec($ch);
global $header;
if ($result) {
$headerSize = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
$header = explode("\r\n", substr($result, 0, $headerSize));
$body = substr($result, $headerSize);
}
if (curl_getinfo($ch, CURLINFO_HTTP_CODE) == '200') {
return $body;
}
if (curl_getinfo($ch, CURLINFO_HTTP_CODE) == '302') {
$location = getHeader("Location");
if (strpos(getHeader("Location"), 'http://') == false) {
$location = getHost($url) . $location;
}
return getHtmlContext($location);
}
return NULL;
}
示例2: sendRequest
function sendRequest($url, $data, $proxy_host, $proxy_port, $debug = true)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, getHeader($data));
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_PROXY, $proxy_host);
curl_setopt($ch, CURLOPT_PROXYPORT, $proxy_port);
$json = curl_exec($ch);
$info = curl_getinfo($ch);
if ($debug) {
echo '<div style="display:none"><br>Информация о запросе:';
echo '<br />';
print_r($info);
echo '<br />';
echo $json;
echo '<br></div>';
}
curl_close($ch);
if ($info['http_code'] === 200) {
echo "Успешный запрос<br />\r\n";
return json_decode($json);
} else {
return false;
}
}
示例3: sendMail
function sendMail($subject, $content, $from, $to, $replyto = "")
{
global $specialchars;
global $Punycode;
$from = $Punycode->encode($from);
$to = $Punycode->encode($to);
$replyto = $Punycode->encode($replyto);
@mail($specialchars->getHtmlEntityDecode($to), "=?" . CHARSET . "?B?" . base64_encode($specialchars->getHtmlEntityDecode($subject)) . "?=", $specialchars->getHtmlEntityDecode($content), getHeader($specialchars->getHtmlEntityDecode($from), $specialchars->getHtmlEntityDecode($replyto)));
}
示例4: getActivityHtml
function getActivityHtml($activity, $translation)
{
$result = "";
$result .= getHeader($translation);
$result .= "<tbody>";
foreach ($activity as $admin) {
$result .= getBody($admin);
}
$result .= "</tbody>";
$result .= "</table>";
return $result;
}
示例5: createIndexFile
function createIndexFile()
{
$indexpage = getHeader();
$indexpage .= markupPosts();
$indexpage .= getFooter();
$out = fopen('index.html', "w");
if (!$out) {
print "OMG";
exit;
}
fwrite($out, $indexpage);
fclose($out);
}
示例6: getActivityHtml
function getActivityHtml($kills, $translation)
{
$result = "";
$result .= getHeader($translation);
$result .= "<tbody>";
$poradie = 0;
foreach ($kills as $kill) {
$poradie += 1;
$result .= getBody($kill, $poradie);
}
$result .= "</tbody>";
$result .= "</table>";
return $result;
}
示例7: WhoAmIRequest
function WhoAmIRequest($request)
{
$authentication = new Authentication('kennethb@thehangar.onmicrosoft.com', 'kennethA20869');
$xml = '
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
' . getHeader('Execute', $authentication) . '
<s:Body>
<Execute xmlns="http://schemas.microsoft.com/xrm/2011/Contracts/Services" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<request i:type="b:WhoAmIRequest" xmlns:a="http://schemas.microsoft.com/xrm/2011/Contracts" xmlns:b="http://schemas.microsoft.com/crm/2011/Contracts">
<a:Parameters xmlns:c="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
<a:RequestId i:nil="true" />
<a:RequestName>WhoAmI</a:RequestName>
</request>
</Execute>
</s:Body>
</s:Envelope>';
return GetSOAPResponse('https://thehangar.crm.dynamics.com/XRMServices/2011/OrganizationData.svc', $xml);
}
示例8: setRequestLog
/**
* 请求日志
* @pamer
*/
private function setRequestLog()
{
$_header = getHeader();
$Requset = '';
if (is_run_evn()) {
if (isset($_SERVER['REQUEST_URI'])) {
$Requset = $_SERVER['REQUEST_URI'];
}
} else {
$Requset = 'cli';
}
$body = 'Run Start' . "\n";
$body .= 'Host:' . (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '') . "\n";
$body .= 'Requset:' . $Requset . "\n";
$body .= 'Ip:' . getClient_id() . "\n";
$body .= 'Method:' . (isset($_SERVER["REQUEST_METHOD"]) ? $_SERVER["REQUEST_METHOD"] : 'cli') . "\n";
$body .= 'Header:' . json($_header) . "\n";
$body .= 'Parameter:' . json(Data::all()) . "\n";
Log::run($body);
}
示例9: getContent
function getContent($fileName)
{
//Get and tratatives log file
$email = file_get_contents($fileName);
function element_to_obj($element)
{
$obj = array("tag" => $element->tagName);
foreach ($element->attributes as $attribute) {
$obj[$attribute->name] = $attribute->value;
}
foreach ($element->childNodes as $subElement) {
if ($subElement->nodeType == XML_TEXT_NODE) {
$obj["html"] = $subElement->wholeText;
} else {
$obj["children"][] = element_to_obj($subElement);
}
}
return $obj;
}
function html_to_obj($html)
{
$dom = new DOMDocument();
$dom->loadHTML($html);
return element_to_obj($dom->documentElement);
}
$json = json_encode(html_to_obj($email), true);
$tamanhoArray = count(json_decode($json)->children[2]->children);
$value = json_decode($json)->children[2]->children;
// Controle do Titulo
for ($i = 0; $i <= $tamanhoArray; $i++) {
$header = getHeader($value[$i]->html);
// Controle do Conteudo
$j = $i + 1;
$data = array('header' => $header, 'data' => $value[$j]->html);
$data_[] = $data;
$i++;
}
return $data_;
}
示例10: session_start
<?php
session_start();
require_once 'connections/db_connection.php';
//if admin is not logged in redirect to home page
if (!isset($_SESSION['admin'])) {
$host = $_SERVER["HTTP_HOST"];
$path = rtrim(dirname($_SERVER["PHP_SELF"]), "/\\");
header("Location: http://{$host}{$path}/index.php");
exit;
}
mysql_select_db($database, $connect);
include 'displays.php';
getHeader('Users', true);
?>
<header class="container limited page-title">
<h1>Users</h1>
</header>
<script type="text/javascript">
$(document).ready(function()
{
$.get("getUsers.php",
function(data)
{
$("#user_list").html(data);
});
});
示例11: doHeader
function doHeader()
{
echo getHeader();
}
示例12: session_start
<?php
session_start();
require_once 'connections/db_connection.php';
//if admin is not logged in redirect to home page
if (!isset($_SESSION['admin'])) {
$host = $_SERVER["HTTP_HOST"];
$path = rtrim(dirname($_SERVER["PHP_SELF"]), "/\\");
header("Location: http://{$host}{$path}/index.php");
exit;
}
mysql_select_db($database, $connect);
include 'displays.php';
getHeader('Edit admin', true);
?>
<header class="container limited page-title">
<h1>Edit admin</h1>
</header>
<section class="container limited">
<?php
if (isset($_SESSION['username_exists'])) {
echo "<h5 class='error'>";
echo $_SESSION['username_exists'];
unset($_SESSION['username_exists']);
echo "</h5>";
}
if (isset($_SESSION['update_admin'])) {
echo "<h5 class='error'>";
echo $_SESSION['update_admin'];
示例13: getHeader
<?php
getHeader();
Posts::handleSiteViewsStatic();
?>
<div align="center" class="col-xs-12 col-sm-12 col-md-2 col-lg-2 col-md-offset-1 col-lg-offset-1">
<a class="btn btn-warning btn-lg"><i class="mdi mdi-download"></i> Download</a>
<span class="help-block">v.<?php
echo getVersion();
?>
Alpha</span>
</div>
<div class="col-xs-12 col-sm-12 col-md-4 col-lg-4 col-md-offset-1 col-lg-offset-1 div_white_left">
<article class="post">
<a href="submit.php"><h3 align="center" style="font-weight: bold;">Submit Page</h3></a>
<p>You have been redirected here from a submit form in our website.</p>
<span>Please confirm that you want to complete the action.</span><br><br>
<span>Action: <?php
echo 'action';
?>
</span>
<br><br>
</article>
</div>
<?php
getFooter();
示例14: _templatesummary
/**
* Load CodeMirror editor and various files information.
*
* @access protected
* @param string $templatename
* @param string $screenname
* @param string $editfile
* @param string $templates
* @param string $files
* @param string $cssfiles
* @param array $otherfiles
* @param array $myoutput
* @return void
*/
protected function _templatesummary($templatename, $screenname, $editfile, $templates, $files, $cssfiles, $otherfiles, $myoutput)
{
$tempdir = Yii::app()->getConfig("tempdir");
$tempurl = Yii::app()->getConfig("tempurl");
Yii::app()->loadHelper("admin/template");
$aData = array();
$time = date("ymdHis");
// Prepare textarea class for optional javascript
$templateclasseditormode = getGlobalSetting('defaulttemplateeditormode');
// default
if (Yii::app()->session['templateeditormode'] == 'none') {
$templateclasseditormode = 'none';
}
$aData['templateclasseditormode'] = $templateclasseditormode;
// The following lines are forcing the browser to refresh the templates on each save
@($fnew = fopen("{$tempdir}/template_temp_{$time}.html", "w+"));
$aData['time'] = $time;
if (!$fnew) {
$aData['filenotwritten'] = true;
} else {
@fwrite($fnew, getHeader());
foreach ($cssfiles as $cssfile) {
$myoutput = str_replace($cssfile['name'], $cssfile['name'] . "?t={$time}", $myoutput);
}
$myoutput = implode("\n", $myoutput);
App()->getClientScript()->registerPackage('jqueryui');
App()->getClientScript()->registerPackage('jquery-touch-punch');
App()->getClientScript()->registerScriptFile(Yii::app()->getConfig('generalscripts') . "survey_runtime.js");
App()->getClientScript()->render($myoutput);
@fwrite($fnew, $myoutput);
@fclose($fnew);
}
if (Yii::app()->session['templateeditormode'] !== 'default') {
$sTemplateEditorMode = Yii::app()->session['templateeditormode'];
} else {
$sTemplateEditorMode = getGlobalSetting('templateeditormode', 'full');
}
$sExtension = substr(strrchr($editfile, '.'), 1);
switch ($sExtension) {
case 'css':
$sEditorFileType = 'css';
break;
case 'pstpl':
$sEditorFileType = 'html';
break;
case 'js':
$sEditorFileType = 'javascript';
break;
default:
$sEditorFileType = 'html';
break;
}
$aData['clang'] = $this->getController()->lang;
$aData['screenname'] = $screenname;
$aData['editfile'] = $editfile;
$aData['tempdir'] = $tempdir;
$aData['templatename'] = $templatename;
$aData['templates'] = $templates;
$aData['files'] = $files;
$aData['cssfiles'] = $cssfiles;
$aData['otherfiles'] = $otherfiles;
$aData['tempurl'] = $tempurl;
$aData['time'] = $time;
$aData['sEditorFileType'] = $sEditorFileType;
$aData['sTemplateEditorMode'] = $sTemplateEditorMode;
$aViewUrls['templatesummary_view'][] = $aData;
return $aViewUrls;
}
示例15: cms_pageheader
function cms_pageheader($section, $meta = '')
{
global $_PSL;
$pagetitle = pslgetText('Gallery');
// The title to be displayed in the browser top
$output = getHeader($pagetitle, $_PSL['metatags']);
addClassRequirement("navbar", $_PSL['moduledir'] . "/" . $_PSL['module']['NavBar'] . "/NavBar.class");
$navbar = pslNew("NavBar");
$output .= $navbar->getNavBar();
return $output;
}