473,569 Members | 2,737 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PHP Header Refresh Issue

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?
Jul 17 '05 #1
11 29548
Tom Post wrote:
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?


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
Jul 17 '05 #2
In article <92************ **************@ posting.google. com>,
tr****@gtsquare d.com (Tom Post) wrote:
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?


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...

Jul 17 '05 #3
.oO(Tom Post)
I am doing a simple php header refresh --
header('refresh : 10; url=msgs.php');


There's no such header in HTTP.

Micha
Jul 17 '05 #4
Michael Fesser wrote:
.oO(Tom Post)
I am doing a simple php header refresh --
header('refresh : 10; url=msgs.php');


There's no such header in HTTP.


Actually, there is. It's a response header on which the browser will act in
the same manner as when a <META HTTP-EQUIV="Refresh" /> tag is included in
an HTML document.

See:

http://tinyurl.com/6ozh3
JW

Jul 17 '05 #5
.oO(Janwillem Borleffs)
Michael Fesser wrote:
.oO(Tom Post)
I am doing a simple php header refresh --
header('refresh : 10; url=msgs.php');
There's no such header in HTTP.

Actually, there is.


Not in RFC 2616 (HTTP 1.1).
It's a response header on which the browser will act in
the same manner as when a <META HTTP-EQUIV="Refresh" /> tag is included in
an HTML document.

See:

http://tinyurl.com/6ozh3


From that site (I hate these MSDN sites ... don't work in my Opera):

REFRESH (46)
Obsolete. Maintained for legacy application compatibility only.

From <http://www.w3.org/Protocols/HTTP/Issues/http-wg.html>:

REFRESH
[...]
Status: Not in 1.1, due to unexplored security implications.

Micha
Jul 17 '05 #6
In article <41************ ***********@new s.euronet.nl>,
"Janwillem Borleffs" <jw@jwscripts.c om> wrote:
Michael Fesser wrote:
.oO(Tom Post)
I am doing a simple php header refresh --
header('refresh : 10; url=msgs.php');


There's no such header in HTTP.


Actually, there is. It's a response header on which the browser will act in
the same manner as when a <META HTTP-EQUIV="Refresh" /> tag is included in
an HTML document.

See:

http://tinyurl.com/6ozh3


Interesting that this site (www.microsoft.com) says:

REFRESH*(46)
Obsolete. Maintained for legacy application compatibility only.

But http://vancouver-webpages.com/META/metatags.detail.html says this is
a Netscape-specific extension. This is what I saw on my own site--IE
didn't like this request and ignored it.

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

Jul 17 '05 #7
Michael Fesser wrote:
From that site (I hate these MSDN sites ... don't work in my Opera):

Switch over to Firefox then.
REFRESH (46)
Obsolete. Maintained for legacy application compatibility only.

From <http://www.w3.org/Protocols/HTTP/Issues/http-wg.html>:

REFRESH
[...]
Status: Not in 1.1, due to unexplored security implications.


The refresh header being obsolete and not implemented in HTTP/1.1 doesn't
mean you cannot use it.

It's the browser that determines whether to react on this header or not. The
following code will redirect you to Google after 10 seconds in most
browsers:

<?php
header("Refresh : 10; url=http://www.google.nl/");
?>
JW

Jul 17 '05 #8
Michael Fesser <ne*****@gmx.ne t> wrote in message news:<00******* *************** **********@4ax. com>...
<snip>
http://tinyurl.com/6ozh3
From that site (I hate these MSDN sites ... don't work in my Opera):


LOL!
REFRESH (46)
Obsolete. Maintained for legacy application compatibility only.

From <http://www.w3.org/Protocols/HTTP/Issues/http-wg.html>:

REFRESH
[...]
Status: Not in 1.1, due to unexplored security implications.


IIRC, header("Locatio n:...") won't work in IIS and in that case the
only header work is header("Refresh ..."). So, it is not actually
obsolete.

FWIW:
<?php
function Redirect2URL($u rl)
{
if (!headers_sent( ))
{
header('Locatio n: '.$url);
//if IIS, then send Refresh header too (as a safe)...
if (stristr($_SERV ER['SERVER_SIGNATU RE'], 'IIS'))
header('Refresh : 0;url='.$url);
}
else
{
echo '<p>Please click this <a href="'.$url.'" >link</a> to
continue...</p>'."\n";
echo '<META HTTP-EQUIV="refresh" CONTENT="0; URL='.$url.'">' ."\n";
}
}
?>

--
| Just another PHP saint |
Email: rrjanbiah-at-Y!com
Jul 17 '05 #9
tr****@gtsquare d.com (Tom Post) wrote in message news:<92******* *************** ****@posting.go ogle.com>...
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?


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

But it behaves exactly the same as using the php header fxn. If I hit
the IE refresh button, the refreshing no longer continues.
Jul 17 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2988
by: abdul bari | last post by:
Hi I was wondering how you apply header referesh to an XSl sheet. I want the generated html page to refresh. The following code doesnt work. <head> <title>sample</title> <xsl:attribute name ="http-equiv">Refresh</xsl:attribute> <xsl:attribute name ="content">5</xsl:attribute> </head>
1
4546
by: John Baker | last post by:
HI again: I have made 2 posts on this issue, and for some reason still haven't got the right result. I have a form which contains a number of totals. These totals use unbound control boxes and are of the form: =Dcount("field","table"). The form contains a number of buttons which trigger queries (using a macro) that update some tables and...
5
2480
by: Andrew Chanter | last post by:
I have a situation where I am using an unbound dialog form to update data in an Access 2002 split back end / front end scenario. The data update is done via an ADO call (direct to the back end db) when the user clicks the save button. The dialog then closes and the user should be able to see the result of their edit in a list view that now...
1
2894
by: Alfons Puig | last post by:
Hi, MSDN documentation about HTTP Response Headers say Refresh is obsolete and maintained for legacy application compatibility only. How can I achieve the same functionality to releoad the new contents of a page? I can use the timer component but, is there a http-like solution?
4
2028
by: John | last post by:
I get the feeling this is a pretty classic problem, but I'm a bit of an uber newber. Apologies! Products page, user enters a quantity and clicks one of my "Add to Cart" buttons, which bubbles up through the datalist and calls a method to AddToCart(cartID,prodID,prodQty). Now, if the user clicks 'refresh', that method is executed again...
9
7726
by: PK9 | last post by:
I'm having an issue with the "Refresh" of an asp.net page. The refresh is actually calling my last onClick event. I thought that asp.net was supposed to be stateless in that it shouldn't remember that I clicked a button before the refresh. Here is what is going on: 1) Page Loads 2) User enters some values, clicks the "Save" button 3)...
19
2198
by: Justin | last post by:
Harlow... i need some help on these... im actually trying to do a page using php... the function is to receive certain parameters from a 3rd party provider... and i need to redirect my page to another page after certain validation. it's ok when i use the url to do the testing... the validation part works fine... scenario as below: if...
0
7614
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7676
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5513
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3642
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2114
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1221
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
938
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.