当前位置:Gxlcms > PHP教程 > php常用的header:301,302,Redirects,404,Javascript,Download,Authentication,编码等设置小结

php常用的header:301,302,Redirects,404,Javascript,Download,Authentication,编码等设置小结

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

301永久跳转

 


302临时重定向跳转

 



404 Page Not Found:

 



Service not avaliable:

 



CSS样式文件:

 



Javascript header脚本:

 



Images图片输出:

For JPEG(jpg): 
 
For PNG: 
 
For BMP: 
 


PDF文件 (output pdf with php):

 



缓存Cache (force browsers not to cache files):

 



Download dialog下载对话框:

 



Authentication安全验证 (force the browser to pop up a Username/Password input window) - only available when PHP is running as an Apache module:

php header编码

header("Content-type: text/html; charset=utf-8"); 

人气教程排行