By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,932 Members | 1,455 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,932 IT Pros & Developers. It's quick & easy.

browser / refresh

P: n/a
is there any way to force a refresh of a page that a user visits??
sorry i am still learning.

vickie
Jul 17 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a

"vickie_raven" <vi**********@hotmail.com> wrote in message
news:d7********************************@4ax.com...
is there any way to force a refresh of a page that a user visits??
sorry i am still learning.

vickie


Setting the appropriate metatag should do it. But do it in PHP, or I'll have
to have you ejected from the group:

<?php
echo '<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">';
?>

Garp
Jul 17 '05 #2

P: n/a
Garp wrote:
"vickie_raven" <vi**********@hotmail.com> wrote in message
news:d7********************************@4ax.com...
is there any way to force a refresh of a page that a user visits??
sorry i am still learning.
Setting the appropriate metatag should do it. But do it in PHP, or I'll have
to have you ejected from the group:

<?php
echo '<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">';
?>


If that is what vickie really wants why not send HTTP headers instead?

<?php
// Date in the past
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");

// always modified
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");

// HTTP/1.1
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);

// HTTP/1.0
header("Pragma: no-cache");
?>

--
USENET would be a better place if everybody read: : mail address :
http://www.catb.org/~esr/faqs/smart-questions.html : is valid for :
http://www.netmeister.org/news/learn2quote2.html : "text/plain" :
http://www.expita.com/nomime.html : to 10K bytes :
Jul 17 '05 #3

P: n/a
vickie_raven wrote:
is there any way to force a refresh of a page that a user visits??


No. Forget "force".

--
Jock
Jul 17 '05 #4

P: n/a
On Fri, 28 May 2004 16:29:48 -0400, vickie_raven <vi**********@hotmail.com>
wrote:
is there any way to force a refresh of a page that a user visits??


You could dispatch goons to the user's house to threaten them with big sticks
until they hit refresh. Otherwise, you're pretty much out of luck as far as
forcing goes.

Since PHP's job is finished once the page is sent to the user, you can't later
do anything that could cause a refresh.

You could send a Location header along with the page, but that just redirects
instantly, and so the user would never see the page in the first place - hardly
a refresh.

An HTML solution (independent of PHP) is using a <meta> tag to request the
browser to refresh after a certain amount of time. The browser doesn't have to
honour this request.

--
Andy Hassall <an**@andyh.co.uk> / Space: disk usage analysis tool
http://www.andyh.co.uk / http://www.andyhsoftware.co.uk/space
Jul 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.