PHP header函数大全

header('Content-Type: text/html; charset=utf-8');
header('Location: http://www.php-note.com/');

<?php
// 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.php-note.com/');// redrict with delay:
header('Refresh: 10; url=http://www.php-note.com/');
//print You will be redirected in 10 seconds;// you could also use the HTML syntax:// <meta http-equiv="refresh" content="10;http://www.php-note.com/ />// 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('') – 60; // or filemtime('$fn'), etc
header('Last-Modified: .gmdate("D, d M Y H:i:s, ' . $time . '"). GMT');// header for telling the browser that the content
// did not get changed
header('HTTP/1.1 304 Not Modified');// set content length ('good for caching'):
header('Content-Length: 1234');// Headers for an download:
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="example.zip"');
header('Content-Transfer-Encoding: binary');// load the file to send:readfile('example.zip');
// Disable caching of the current document:
header('Cache-Control: no-cache, no-store, max-age=0, must-revalidate');
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
// Date in the pastheader('Pragma: no-cache');// set content type:
header('Content-Type: text/html; charset=iso-8859-1');
header('Content-Type: text/html; charset=utf-8');// plain text file
header('Content-Type: text/plain');// JPG picture
header('Content-Type: image/jpeg');// ZIP file
header('Content-Type: application/zip');// PDF file
header('Content-Type: application/pdf');header('Content-Type: audio/mpeg');// Audio MPEG ('MP3,…') file
header('Content-Type: application/x-shockwave-flash');// 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;
?>

页面跳转中。。。

<?php
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
echo '<html xmlns="http://www.w3.org/1999/xhtml">';
echo '<head>';
echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />';
echo '<meta http-equiv="refresh" content="0;url=' . oppo_sync_logout . '" />';
echo '<title>页面跳转中...</title>';
echo '</head>';
echo '<body>';
echo '    <div style="text-align:left;margin-top:10px;">页面跳转中...</div>';
echo '</body>';
echo '</html>';
die();
?>

转载于:https://www.cnblogs.com/blueskycc/p/5364093.html

PHP header函数大全相关推荐

  1. php header 转向,php使用header函数的http头设置大全(包含301转向及404状态)

    最近做B2B系统,为给每个会员自动赠送的二级域名店铺做一些SEO优化,要用到header函数来设置域名的301转向以及404状态,以下是从网上找的header函数的http头设置大全,收藏到我的博客中 ...

  2. LoadRunner 常用函数大全+1

    1 LoadRunner 函数大全之中文解释 // button_press 函数激活指定的推按钮. int button_press ( LPCSTR button ); // button_set ...

  3. LoadRunner函数大全

    转:http://blog.csdn.net/windone0109/article/details/4353916 1 LoadRunner 函数大全之中文解释 // button_press 函数 ...

  4. php中files和FILRS,PHP_php利用header函数实现文件下载时直接提示保存,复制代码 代码如下: ?php $fil - phpStudy...

    php利用header函数实现文件下载时直接提示保存 复制代码 代码如下: $filename = '路径+实际文件名'; //文件的类型 header('Content-type: applicat ...

  5. php文件提示保存文件,php header函数文件下载时直接提示保存

    如何解决在浏览器访问PDF文件时不直接在浏览器中显示文件内容,而是提示保存呢? 即使用php header函数文件下载时直接提示保存,大家做个参考. 例子: 代码示例: $filename = '路径 ...

  6. php header保存文件,php利用header函数实现文件下载时直接提示保存

    复制代码 代码如下: 下面是网上常用的方法 复制代码 代码如下: if (isset($link)) { Header("HTTP/1.1 303 See Other"); Hea ...

  7. php 内置函数大全

    https://www.cnblogs.com/zgxblog/p/10330808.html php内置函数大全 第2章 Apache函数 15 2.1 Apache信息获取类函数 15 2.1.1 ...

  8. c语言s开头的函数以及作用,C语言函数大全-s开头-完整版.doc

    C语言函数大全-s开头-完整版 C语言函数大全(s开头) 函数名: sbrk 功能: 改变数据段空间位置 用法: char *sbrk(int incr); 程序例: #include#include ...

  9. excel函数大全_让你的EXCEL工作效率翻倍的函数大全

    详细的函数说明和应用实例可查看我上传的<EXCEL快速学习教程视频>对应各类函数教程 常用函数大全 使用函数:公式选项卡>函数库>插入函数.常用函数.最近使用函数.财务.逻辑. ...

最新文章

  1. unix oracle控制台,Linux平台下启动oracle11gEM控制台
  2. linux at自动挂化,linux的at定时任务的使用
  3. 08函数的参数 进阶
  4. Tomcat源码解析五:Tomcat请求处理过程
  5. 51Nod 1043 幸运号码
  6. 2019.6.27刷题统计
  7. 复杂网络学习的一些常用数据集
  8. 无刷直流电机的基本工作原理
  9. 6个技巧,让你十年前的老电脑流畅起来。
  10. seo具体怎么优化-优化SEO的方法
  11. 使用CNN进行情感分析(Sentiment Analysis)
  12. 就业喜报|最高薪资15K,平均7216元,这个双十一不做“吃圭人”!
  13. Linux上的Shebang符号(#!)
  14. 【上】CS229 吴恩达机器学习 习题作业答案 problem sets 03 PS03(全部问题解答,欢迎各位前辈指教)
  15. 如何鉴别电脑电源是否虚标(实际输出瓦数)
  16. SpringBoot + JWT + Redis 开源知识社区系统
  17. 如何将excel中的数据导入到epidata 中
  18. Android常用颜色大全
  19. 绘制简单的美国疫情地图(plotlty+request)
  20. 什么是六顶思考帽子? / What is Six Think Hat in Strategic Analysis?

热门文章

  1. C/C++高级算法之绘制曼德布洛特集
  2. java接口自动化Excel占位符_基于maven+java+TestNG+httpclient+poi+jsonpath+ExtentReport的接口自动化测试框架...
  3. 畅享10e会有鸿蒙吗,功能虽小作用很大 华为畅享10e隐藏功能大揭秘
  4. html的页面宽高变形问题,CSS+div 设计的网页在不同浏览器中变形的问题
  5. c# opencv 轮廓检测_C#中OpenCVSharp实现轮廓检测
  6. 位置环PID模糊C语言,PID和位置环
  7. pat 乙级 1020 月饼(C++实现)
  8. 【渝粤题库】陕西师范大学152208 公共危机管理
  9. python string 方法,python字符串的方法与操作大全
  10. mysql怎么对比表结构_mysql查看表结构2种方式对比