免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 18614 | 回复: 16
打印 上一主题 下一主题

php 页面跳转 header("Location:/"); [复制链接]

论坛徽章:
0
跳转到指定楼层
[收藏(0)] [报告]
发表于 2006-08-02 14:05 |只看该作者 |正序浏览
annot modify header information - headers already sent by (output started at /home/wwwroot/class/wap_class.php:1)

知道  header("Location:/"); 可以实现跳转,但是由于头部已经用了

  1. header("content-type:text/vnd.wap.wml;charset=utf-8");
  2. header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
  3. header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");  
  4. header("Cache-Control: no-store, no-cache, must-revalidate");
  5. header("Pragma: no-cache");
复制代码


header("Location:/");一定要在其他header前,有什么办法可以清空前面的header,让我实现跳转。

论坛徽章:
0
16 [报告]
发表于 2013-04-16 11:49 |只看该作者

论坛徽章:
0
15 [报告]
发表于 2013-04-15 14:49 |只看该作者
出现这种情况,就该检查你的流程了。

论坛徽章:
3
未羊
日期:2013-11-18 15:17:06酉鸡
日期:2013-12-06 17:07:16天蝎座
日期:2014-06-11 12:37:07
14 [报告]
发表于 2013-04-08 23:55 |只看该作者
直接使用html跳转吧。没办法的。。。
  1. <meta http-equiv=refresh content='0;url=a.php'>;<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />;
复制代码

论坛徽章:
0
13 [报告]
发表于 2013-04-08 16:20 |只看该作者
js直接实现跳转多好了~!@

论坛徽章:
3
未羊
日期:2013-11-18 15:17:06酉鸡
日期:2013-12-06 17:07:16天蝎座
日期:2014-06-11 12:37:07
12 [报告]
发表于 2013-04-08 13:06 |只看该作者
回复 8# HonestQiao
  1. <?php
  2. include '9.php';
  3. $result=new web_post();
  4. $result->website('163.com','post');
  5. flush();header('location: a.php');

  6. ?>
复制代码
跳转都不成功。。。

论坛徽章:
0
11 [报告]
发表于 2006-08-02 18:05 |只看该作者
ob_start

ob_flush

论坛徽章:
0
10 [报告]
发表于 2006-08-02 16:48 |只看该作者
使用输出缓存吧~

论坛徽章:
0
9 [报告]
发表于 2006-08-02 16:48 |只看该作者
在所有代码的最前面加入ob_start 调用~~

注意是最前面,连个空格都不要有~~

论坛徽章:
0
8 [报告]
发表于 2006-08-02 16:27 |只看该作者
如果header 前面有东西,headers_sent == 1 的话也是无法实现跳转的.还是location的好

论坛徽章:
1
技术图书徽章
日期:2013-12-05 23:25:45
7 [报告]
发表于 2006-08-02 15:44 |只看该作者
我就是打开手册随时拷贝的。
  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP