当前位置: 首页>>代码示例>>PHP>>正文


PHP MAX_header函数代码示例

本文整理汇总了PHP中MAX_header函数的典型用法代码示例。如果您正苦于以下问题:PHP MAX_header函数的具体用法?PHP MAX_header怎么用?PHP MAX_header使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了MAX_header函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: MAX_imageServe

/**
 * @package    MaxDelivery
 * @subpackage image
 *
 * This library defines functions that need to be available to
 * the ai delivery script
 *
 */
function MAX_imageServe($aCreative, $filename, $contenttype)
{
    // Check if the browser sent a If-Modified-Since header and if the image was
    // modified since that date
    if (!isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) || $aCreative['t_stamp'] > strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE'])) {
        MAX_header("Last-Modified: " . gmdate('D, d M Y H:i:s', $aCreative['t_stamp']) . ' GMT');
        if (isset($contenttype) && $contenttype != '') {
            switch ($contenttype) {
                case 'swf':
                    MAX_header('Content-type: application/x-shockwave-flash; name=' . $filename);
                    break;
                case 'dcr':
                    MAX_header('Content-type: application/x-director; name=' . $filename);
                    break;
                case 'rpm':
                    MAX_header('Content-type: audio/x-pn-realaudio-plugin; name=' . $filename);
                    break;
                case 'mov':
                    MAX_header('Content-type: video/quicktime; name=' . $filename);
                    break;
                default:
                    MAX_header('Content-type: image/' . $contenttype . '; name=' . $filename);
                    break;
            }
        }
        echo $aCreative['contents'];
    } else {
        // Send "Not Modified" status header
        MAX_sendStatusCode(304);
    }
}
开发者ID:hostinger,项目名称:revive-adserver,代码行数:39,代码来源:image.php

示例2: MAX_sendStatusCode

function MAX_sendStatusCode($iStatusCode)
{
    $aConf = $GLOBALS['_MAX']['CONF'];
    $arr = array(100 => 'Continue', 101 => 'Switching Protocols', 200 => 'OK', 201 => 'Created', 202 => 'Accepted', 203 => 'Non-Authoritative Information', 204 => 'No Content', 205 => 'Reset Content', 206 => 'Partial Content', 300 => 'Multiple Choices', 301 => 'Moved Permanently', 302 => 'Found', 303 => 'See Other', 304 => 'Not Modified', 305 => 'Use Proxy', 306 => '[Unused]', 307 => 'Temporary Redirect', 400 => 'Bad Request', 401 => 'Unauthorized', 402 => 'Payment Required', 403 => 'Forbidden', 404 => 'Not Found', 405 => 'Method Not Allowed', 406 => 'Not Acceptable', 407 => 'Proxy Authentication Required', 408 => 'Request Timeout', 409 => 'Conflict', 410 => 'Gone', 411 => 'Length Required', 412 => 'Precondition Failed', 413 => 'Request Entity Too Large', 414 => 'Request-URI Too Long', 415 => 'Unsupported Media Type', 416 => 'Requested Range Not Satisfiable', 417 => 'Expectation Failed', 500 => 'Internal Server Error', 501 => 'Not Implemented', 502 => 'Bad Gateway', 503 => 'Service Unavailable', 504 => 'Gateway Timeout', 505 => 'HTTP Version Not Supported');
    if (isset($arr[$iStatusCode])) {
        $text = $iStatusCode . ' ' . $arr[$iStatusCode];
        if (!empty($aConf['delivery']['cgiForceStatusHeader']) && strpos(php_sapi_name(), 'cgi') !== 0) {
            MAX_header('Status: ' . $text);
        } else {
            MAX_header($_SERVER["SERVER_PROTOCOL"] . ' ' . $text);
        }
    }
}
开发者ID:JackyKit,项目名称:revive-adserver,代码行数:13,代码来源:ti.php

示例3: MAX_cookieSendP3PHeaders

/**
 * Send the appropriate P3P headers to attempt to permit 3rd party cookies
 *
 */
function MAX_cookieSendP3PHeaders()
{
    // Send P3P headers
    if ($GLOBALS['_MAX']['CONF']['p3p']['policies']) {
        MAX_header("P3P: " . _generateP3PHeader());
    }
}
开发者ID:Jaree,项目名称:revive-adserver,代码行数:11,代码来源:cookie.php

示例4: OA_Start

/**
 * Starts or continue existing session
 *
 * @param unknown_type $checkRedirectFunc
 */
function OA_Start($checkRedirectFunc = null)
{
    $conf = $GLOBALS['_MAX']['CONF'];
    global $session;
    // Send no cache headers
    MAX_header('Pragma: no-cache');
    MAX_header('Cache-Control: no-cache, no-store, must-revalidate');
    MAX_header('Expires: 0');
    if (RV_INSTALLATION_STATUS == RV_INSTALLATION_STATUS_INSTALLED) {
        phpAds_SessionDataFetch();
    }
    if (!OA_Auth::isLoggedIn() || OA_Auth::suppliedCredentials()) {
        // Required files
        include_once MAX_PATH . '/lib/max/language/Loader.php';
        // Load the required language files
        Language_Loader::load('default');
        phpAds_SessionDataRegister(OA_Auth::login($checkRedirectFunc));
        $aPlugins = OX_Component::getListOfRegisteredComponentsForHook('afterLogin');
        foreach ($aPlugins as $i => $id) {
            if ($obj = OX_Component::factoryByComponentIdentifier($id)) {
                $obj->afterLogin();
            }
        }
    }
    // Overwrite certain preset preferences
    if (!empty($session['language']) && $session['language'] != $GLOBALS['pref']['language']) {
        $GLOBALS['_MAX']['CONF']['max']['language'] = $session['language'];
    }
    // Check if manual account switch has happened and migrate to new global variable
    if (isset($session['accountSwitch'])) {
        $GLOBALS['_OX']['accountSwtich'] = $session['accountSwitch'];
        unset($session['accountSwitch']);
        phpAds_SessionDataStore();
    }
}
开发者ID:akirsch,项目名称:revive-adserver,代码行数:40,代码来源:config.php

示例5: MAX_header

<?php

/**
 * apStatsGraphs for the OpenX ad server (Free Version).
 *
 * @author Matteo Beccati
 * @copyright 2009 AdserverPlugins.com
 * @license http://creativecommons.org/licenses/by-nd/3.0/
 *
 * $Id$
 */
// Prepare the OpenX environment via standard external OpenX scripts
require_once '../../../../init.php';
require_once '../../config.php';
require_once './lib/apGraph.php';
// Limit access to logged in users
OA_Permission::enforceAccount(OA_ACCOUNT_ADMIN, OA_ACCOUNT_MANAGER, OA_ACCOUNT_ADVERTISER, OA_ACCOUNT_TRAFFICKER);
// Custom no cache - OFC seems to have issues with the standard OpenX headers
MAX_header('Cache-Control: private, max-age=0, no-store');
MAX_header('Expires: ' . date('r'));
$oGraph = AP_Graph::factory($_GET);
$oGraph->displayGraph();
开发者ID:SamWinchester,项目名称:revive-adserver,代码行数:22,代码来源:graph-data.php

示例6: MAX_cacheGetGoogleJavaScript

<?php

/*
+---------------------------------------------------------------------------+
| Revive Adserver                                                           |
| http://www.revive-adserver.com                                            |
|                                                                           |
| Copyright: See the COPYRIGHT.txt file.                                    |
| License: GPLv2 or later, see the LICENSE.txt file.                        |
+---------------------------------------------------------------------------+
*/
// Require the initialisation file
require_once '../../init-delivery.php';
// Required files
require_once MAX_PATH . '/lib/max/Delivery/cache.php';
// Get JS
$output = MAX_cacheGetGoogleJavaScript();
// Output JS
MAX_commonSendContentTypeHeader("application/x-javascript");
MAX_header("Expires: " . gmdate('r', time() + 86400));
echo $output;
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:21,代码来源:ag.php


注:本文中的MAX_header函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。