当前位置:Gxlcms > PHP教程 > PHPheader()函数常用方法_PHP教程

PHPheader()函数常用方法_PHP教程

时间:2021-07-01 10:21:17 帮助过:7人阅读

//定义编码

//Atom

//CSS

//Javascript

//JPEG Image

//JSON

//PDF

//RSS

//Text (Plain)

//XML

// ok

//设置一个404头:

//设置地址被永久的重定向

//转到一个新地址

//文件延迟转向:
print 'You will be redirected in 10 seconds';
//当然,也可以使用html语法实现
// header('Content-Transfer-Encoding: binary');
// load the file to send:
readfile('example.zip');
// 对当前文档禁用缓存
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past
header('Pragma: no-cache');
//设置内容类型:
header('Content-Type: text/html; charset=utf-8');
header('Content-Type: text/plain'); //纯文本格式
header('Content-Type: image/jpeg'); //JPG***
header('Content-Type: application/zip'); // ZIP文件
header('Content-Type: application/pdf'); // PDF文件
header('Content-Type: audio/mpeg'); // 音频文件
header('Content-Type: application/x-shockw**e-flash'); //Flash动画
//显示登陆对话框
header('WWW-Authenticate: Basic realm="Top Secret"');
print 'Text that will be displayed if the user hits cancel or ';
print 'enters wrong login data';

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/753935.htmlTechArticle//定义编码 //Atom //CSS //Javascript //JPEG Image //JSON //PDF //RSS //Text (Plain) //XML // ok //设置一个404头: //设置地址被永久的重定向 //转到一个新地址...

人气教程排行