|
復制代碼 代碼如下:
<?php
/*** Function: php header() examples (php)
** Desc: Some examples on how to use the header() function of phpYou find a detailed tutorial at expertsrt.com (English) or at ffm.juNETz.de (German).These is also a good help about caching at web-caching.com.
** Example: see below. <br/><br/><b>Tip:</b> You can use these sites to check your headers: <a href="http://web-sniffer.NET/">web-sniffer.NET</a>, <a >delorie.com</a> or <a >www.forret.com</a>.
** Author: Jonas John
*/
// fix 404 pages:
header('HTTP/1.1 200 OK');
// set 404 header:
header('HTTP/1.1 404 Not Found');
// set Moved Permanently header (good for redrictions)
// use with location header
header('HTTP/1.1 301 Moved Permanently');
// redirect to a new location:
header('Location: http://www.example.org/');
// redrict with delay:
header('Refresh: 10; url=http://www.example.org/');
print 'You will be redirected in 10 seconds';
// you could also use the HTML syntax:// <meta http-equiv="refresh" content="10;http://www.example.org/ />
// override X-Powered-By: php:
header('X-Powered-By: php/4.4.0');
header('X-Powered-By: Brain/0.6b');
// content language (en = English)
header('Content-language: en');
// last modified (good for caching)
$time = time()
主站蜘蛛池模板:
东兴市|
赞皇县|
行唐县|
永吉县|
阿鲁科尔沁旗|
达拉特旗|
安平县|
花莲市|
赤城县|
滨州市|
东丽区|
突泉县|
综艺|
宁武县|
金门县|
建阳市|
酉阳|
株洲县|
楚雄市|
丰原市|
永寿县|
白银市|
松阳县|
贵阳市|
台中市|
石林|
梧州市|
富平县|
湖北省|
洞头县|
鄂伦春自治旗|
龙州县|
龙井市|
西峡县|
迭部县|
徐州市|
花莲市|
进贤县|
乳源|
山阳县|
永康市|