PHP标头刷新问题 [英] PHP Header Refresh Issue

查看:50
本文介绍了PHP标头刷新问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在做一个简单的php标题刷新 -

标题(''刷新:10; url = msgs.php'');

只做一个每10秒回复一次我的脚本。当页面第一次加载时,事情很有效,但是如果最终用户点击F5或

刷新按钮,则页面会无限期地停止刷新。任何

想法怎么做才能让页面永久刷新而不管最终用户按下什么

I am doing a simple php header refresh --
header(''refresh: 10; url=msgs.php'');
that just does a call back to my script every 10 seconds. Things work
great when the page is first loaded up, but if the end user hits F5 or
the refresh button, then the page stops refreshing indefinately. Any
ideas how to make it so that the page perpetually refreshes regardless
of what the end user presses?

推荐答案

Tom Post写道:
Tom Post wrote:
我正在做一个简单的php标题刷新 -
标题(''刷新:10; url = msgs.php '');
只需每10秒钟回调一次我的脚本。当页面首次加载时,事情很有效,但如果最终用户点击F5或刷新按钮,页面将无法正常刷新。任何
想法如何使页面永久刷新,无论最终用户按什么?
I am doing a simple php header refresh --
header(''refresh: 10; url=msgs.php'');
that just does a call back to my script every 10 seconds. Things work
great when the page is first loaded up, but if the end user hits F5 or
the refresh button, then the page stops refreshing indefinately. Any
ideas how to make it so that the page perpetually refreshes regardless
of what the end user presses?







< meta http-equiv =" refresh"含量=" 10; URL = msgs.php" />

< head>中的
页面的一部分,而不是使用PHP header()调用。


-

Jasper Bryant-Greene

白菜促销



Put

<meta http-equiv="refresh" content="10; url=msgs.php" />

in the <head> section of the page, instead of using the PHP header() call.

--
Jasper Bryant-Greene
Cabbage Promotions


在文章< 92 ************************** @发布。 google.com>,
tr****@gtsquared.com (Tom Post)写道:
In article <92**************************@posting.google.com >,
tr****@gtsquared.com (Tom Post) wrote:
我正在做一个简单的php标题刷新 -
标题(''刷新:10; url = msgs.php'');
只是回电话我的脚本每10秒钟一次。当页面首次加载时,事情很有效,但如果最终用户点击F5或刷新按钮,页面将无法正常刷新。任何
想法如何使页面永久刷新,无论最终用户按什么?
I am doing a simple php header refresh --
header(''refresh: 10; url=msgs.php'');
that just does a call back to my script every 10 seconds. Things work
great when the page is first loaded up, but if the end user hits F5 or
the refresh button, then the page stops refreshing indefinately. Any
ideas how to make it so that the page perpetually refreshes regardless
of what the end user presses?




我想你是将服务器发送的标题信息混淆为浏览器< meta http-equiv =" Refresh">标签。


我在php上的这本书并没有描述刷新:。

header()函数的功能。它描述了重定向,过期和缓存

的东西,身份验证和内容类型,但没有刷新。也没有
http://us4.php。 net / manual / en / function.header.php


你可能选择了错误的方法来实现它。您可以通过查看浏览器和服务器

通过telneting进入服务器并伪装成浏览器来发送信息来进一步检查这一点。

某些浏览器(如iCab)具有日志功能,可保留

活动的记录。如果您的浏览器支持它,请尝试打开该功能。


如果您将标头编码为html会发生什么:


echo"< HTML> \ n",

"< HEAD> \ n",

"< META HTTP-EQUIV =''刷新''内容= '10; URL = msgs.php''> \ n" ;;


还要注意,有些浏览器不太喜欢刷新。我已经将b $ b从我的网站上删除了,因为Mac上的IE没有很好的回复

给它。


-

DeeDee,别按下按钮!迪迪!没有! Dee ...



I think you''re confusing the header information that the server sends to
the browser with the <meta http-equiv="Refresh"> tag.

The book I have on php doesn''t describe the "refresh:" feature of the
header() function. It describes redirections, expirations and cache
stuff, authentication, and content-type, but no refresh. Nor does
http://us4.php.net/manual/en/function.header.php

It could be you''ve chosen the wrong way to implement this. You can
further check this by looking at the information the browser and server
are sending by telneting into the server and pretending to be a browser.
Some browsers like iCab have a log feature that keeps a transcript of
activity. Try turning on that feature if you browser supports it.

What happens if you code the header as html:

echo "<HTML>\n",
"<HEAD>\n",
"<META HTTP-EQUIV=''Refresh'' CONTENT=''10; URL=msgs.php''>\n";

Also be aware that some browsers don''t like the refresh very well. I''ve
had to remove it from my site because IE on the Mac didn''t respond well
to it.

--
DeeDee, don''t press that button! DeeDee! NO! Dee...


.oO(Tom Post)
.oO(Tom Post)
我正在做一个简单的php标题刷新 - -
标题(''刷新:10; url = msgs.php'');
I am doing a simple php header refresh --
header(''refresh: 10; url=msgs.php'');




HTTP中没有这样的标题。 />

Micha



There''s no such header in HTTP.

Micha


这篇关于PHP标头刷新问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆