|
復制代碼 代碼如下:
<?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()
主站蜘蛛池模板:
天峨县|
临泽县|
来凤县|
迁安市|
依兰县|
苍南县|
新丰县|
遵化市|
新绛县|
辽阳县|
余江县|
武乡县|
晋城|
曲沃县|
临夏县|
翁牛特旗|
兰坪|
登封市|
玉溪市|
阿勒泰市|
南丹县|
淳化县|
会泽县|
日喀则市|
涡阳县|
松江区|
玉林市|
永平县|
会同县|
鱼台县|
连城县|
抚州市|
永宁县|
郑州市|
海安县|
监利县|
荥经县|
新民市|
孝感市|
英吉沙县|
同江市|