Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

About "no-cache"

0 views
Skip to first unread message

Science

unread,
Aug 21, 2001, 3:36:59 AM8/21/01
to php-w...@lists.php.net
Hi all,
I am using cookie to write a counting page but when the page is refreshed,
it will increase by 1 automatically.
According to this problem, I used following lines but it doesn't work
----------------------------------------------------------------------------
--
header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header ("Cache-Control: no-cache, must-revalidate");
header ("Pragma: no-cache");
----------------------------------------------------------------------------
---
even I used html script
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">

Well, Is there anyone who knows how to prevent the page to be cached?

Thanks a lot


Matthias Maar

unread,
Aug 24, 2001, 3:25:33 AM8/24/01
to php-w...@lists.php.net
Hi.

Do you really think preventing the browser from caching the page is what you
need here? I think no.
Whenever the page is shown/reloaded you need to check if the user already
has been "counted". This may be done by setting some information in a cookie
(you mentioned one). The code for your counter just has to get that
information and increase when not set.
Or did I get something wrong?

MfG
Maar

----------------------------------------
Matthias Maar
Lehrstuhl für Informatik I
Universität Würzburg
Am Hubland
D-97074 Würzburg
Germany
Tel.: ++49 (0) 931/888-4941
Fax: ++49 (0) 931/888-4600
http://www1.informatik.uni-wuerzburg.de

"Science" <mscie...@us.sina.com> schrieb im Newsbeitrag
news:2001082119313...@pb1.pair.com...

Science

unread,
Aug 26, 2001, 12:57:26 PM8/26/01
to php-w...@lists.php.net
Hi,
Well, I didn't write the counting number into the cookie. For example: I
use "if(isset$test)" so when I reload the page the variable $test is still
set so that it will count again. I wonder if there is any ways to prevent
this situation?
Thanks

DP

"Matthias Maar" <ma...@informatik.uni-wuerzburg.de> źśźgŠóślĽó
news:2001082408275...@pb1.pair.com...

0 new messages