本文整理汇总了PHP中getHeader函数的典型用法代码示例。如果您正苦于以下问题:PHP getHeader函数的具体用法?PHP getHeader怎么用?PHP getHeader使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getHeader函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:t0n9,项目名称:PHPscan,代码行数:29,代码来源:s.php
示例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;
}
}
开发者ID:phpsong,项目名称:ExtJS5-Yii2,代码行数:28,代码来源:xmm.php
示例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)));
}
开发者ID:Novo1987,项目名称:mozilo2.0,代码行数:9,代码来源:Mail.php
示例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;
}
开发者ID:ezpz-cz,项目名称:web-pages,代码行数:12,代码来源:functions.php
示例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);
}
开发者ID:h-xx,项目名称:python-simple-blog,代码行数:13,代码来源:postfunctions.php
示例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;
}
开发者ID:ezpz-cz,项目名称:web-pages,代码行数:14,代码来源:functions.php
示例7: WhoAmIRequest
function WhoAmIRequest($request)
{
$authentication = new Authentication('[email protected]', '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);
}
开发者ID:kgatjens,项目名称:crm-php,代码行数:18,代码来源:soap2.php
示例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);
}
开发者ID:v3u3i87,项目名称:upadd,代码行数:24,代码来源:Application.php
示例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_;
}
开发者ID:xhue,项目名称:pr3d4t0r,代码行数:39,代码来源:function.php
示例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);
});
});
开发者ID:johnbamptonoooo,项目名称:SocialProject,代码行数:31,代码来源:users.php
示例11: doHeader
function doHeader()
{
echo getHeader();
}
开发者ID:GuillaumeSmaha,项目名称:LimeSurvey,代码行数:4,代码来源:common_helper.php
示例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'];
开发者ID:johnbamptonoooo,项目名称:SocialProject,代码行数:31,代码来源:editAdmin.php
示例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();
开发者ID:VSG24,项目名称:ccms,代码行数:27,代码来源:submit.php
示例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;
}
开发者ID:Narasimman,项目名称:UrbanExpansion,代码行数:82,代码来源:templates.php
示例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;
}
开发者ID:BackupTheBerlios,项目名称:milaninegw-svn,代码行数:11,代码来源:phpslash.inc.php
示例16: 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('New product', true);
?>
<header class="container limited page-title">
<h1>New product</h1>
</header>
<section class="container limited">
<?php
if (isset($_SESSION['insert_product'])) {
echo "<h5 class='error'>";
echo $_SESSION['insert_product'];
unset($_SESSION['insert_product']);
echo "</h5>";
}
?>
开发者ID:johnbamptonoooo,项目名称:SocialProject,代码行数:29,代码来源:newProduct.php
示例17: define
<?php
/**
* Rest client services.
* @author KikApp PHP Generator
* @version 1.0
*/
define('_BLOB_PATH', "http://www.devxtend.com/nicolas/DynamicComboBoxExample/services/");
define('_FOLDER', "PublicStorage/");
$fileName = getName() . "." . getExtension(getHeader("Content-Type"));
fwrite_stream(_FOLDER . $fileName, file_get_contents('php://input'));
echo json_encode(getResponse($fileName));
function getResponse($fileName)
{
header('Content-Type: application/json; charset=utf-8');
header('HTTP/ 201 ');
header('GeneXus-Object-Id: gxupload:' . _FOLDER . $fileName);
$data = array('object_id' => _FOLDER . $fileName);
return $data;
}
function getHeader($header)
{
foreach (getallheaders() as $name => $value) {
if ($name == $header) {
return $value;
}
}
}
function fwrite_stream($path, $string)
{
$fp = fopen($path, 'w');
开发者ID:KikAppTools,项目名称:KikAppExamples,代码行数:31,代码来源:gxobject.php
示例18: session_start
<?php
session_start();
include "config.php";
$uid = $_GET["uid"];
$sql = "SELECT * FROM `user` \r\nleft join `dept` on `user`.`dept` = `dept`.`deptid`\r\nwhere `uid` = '{$uid}' ";
include "connectdb.php";
include "include/view.inc.php";
getHeader("User Edit page", "User Edit page");
?>
<main>
<div class="container">
<div class="row">
<div class="col-sm-2"></div><!-- end col -->
<div class="col-sm-8">
<?php
mysql_query("USE siitticket");
$result = mysql_query($sql);
if (mysql_num_rows($result) != 0) {
while ($rec = mysql_fetch_array($result)) {
?>
<form name = "newUser" method = "POST" action = "editUserProcess.php" role="form">
<div class="form-group">
<label for="title">Title:</label>
<input type="text" class="form-control" id="title" name="title" value ="<?php
echo $rec["title"];
?>
" >
</div>
<div class="form-group">
<label for="name">ชื่อ - นามสกุล:</label>
<input type="text" class="form-control" id="name" name="name" value ="<?php
开发者ID:jiyokaa,项目名称:ticket,代码行数:31,代码来源:editUser.php
示例19: handleBusiness
require "_admin/_globals.php";
require CLASS_MP_BUSINESS;
require CLASS_ADS;
$biz = new handleBusiness();
$ads = new handleAds();
$page = 1;
if ($_GET["page"] != "") {
$page = $_GET["page"];
}
$list_biz = $biz->searchBusinesses($_GET["search"], $_GET["city"], $_GET["alpha"], $page);
$map_pointer = $list_biz["cords"];
$list_cats = $biz->listCats($_GET["search"], 1);
?>
<?php
getHeader("public", "yes");
?>
<div class="content-full">
<div id="link-column-container" class="white">
<div id="link-column">
<?php
if ($list_cats["counter"] != "0") {
echo $list_cats["display"];
}
if ($list_biz["cities"] != "") {
echo $list_biz["cities"];
}
?>
</div>
</div>
开发者ID:jboydston,项目名称:shop.getlocal.net,代码行数:31,代码来源:search.php
示例20: 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 user', true);
?>
<header class="container limited page-title">
<h1>Edit user</h1>
</header>
<section class="container limited">
<h5 class="error">
<?php
if (isset($_SESSION['username_exists'])) {
echo $_SESSION['username_exists'];
unset($_SESSION['username_exists']);
}
if (isset($_SESSION['update_user'])) {
echo $_SESSION['update_user'];
unset($_SESSION['update_user']);
开发者ID:johnbamptonoooo,项目名称:SocialProject,代码行数:31,代码来源:editUser.php
注:本文中的getHeader函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论