background image

header('Content-Type: audio/mpeg'); 

// Audio MPEG (MP3,...) file 
header('Content-Type: application/x-shockwave-flash'); 

// 显示登录对话框,可以用来进行 HTTP 认证
// Flash animation// show sign in box 
header('HTTP/1.1 401 Unauthorized'); 
header('WWW-Authenticate: Basic realm="Top Secret"'); 
print 'Text that will be displayed if the user hits cancel or ';
print 'enters wrong login data';?>

// 发送一个 200 正常响应
header("HTTP/1.1 200 OK");
// 发送一个 404 找不到资源响应
header('HTTP/1.1 404 Not Found');
// 发送一个 301 永久重定向
header('HTTP/1.1 301 Moved Permanently');
// 发送一个 503 网站暂时不能访问
header('HTTP/1.1 503 Service Temporarily Unavailable');
// 网页重定向
header('Location: http://www.jb51.net');
// 设置网页 3 秒后重定向
header('Refresh: 3; url=http://www.jb51.net');
echo '网页将在 3 秒后跳转到 http://www.jb51.net';
// 设置网页编码
header('Content-Type: text/html; charset=utf-8');
// 设置网页输出一个图片流
header('Content-Type: image/jpeg');
// 设置网页输出一个 pdf 文档
header('Content-Type: application/pdf');
// 设置网页输出一个 zip 文档
header('Content-Type: application/zip');