Re: Refreshing
| From: | Matthew Leverton | Date: | Tue, 13 Jun 2000 16:25:27 +0000 |
| Subject: | Re: Refreshing | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-1727@lists.php.net to get a copy of this message | ||
Well, there's always the headers. You can set a page to no-cache, but this
may cause unwanted side effects. Like if you hit back on the browser, then
the user will see a message saying to refresh their browser. That's all good
and well, but lets say that previous page added something to a database. If
the user refreshes then it is again added to the database (unless obviously
you are checking for duplicate entries.)
So, I've found two ways of dealing with it:
1: Set the headers to no-cache. This may or may not cause side effects,
depending on your site.
2: Allow the page to be cached via the normal headers, but send a
"?_nocache=TIMESTAMP" (or random number) via the URL.
Example: test.php4?_nocache=<?random(10000,99999)?>
Both Netscape and IE will reload the page -- EVEN if it has been cached
previously -- , as it has a different parameter. I usually use a timestamp
to assure the number is always different for a single user.
This has worked the best for me in live Internet applications.
--
Matthew Leverton - matthew@aeroinc.net -
http://www.allegro.cc
-----Original Message-----
From: Phillip S. Baker <phillip@wordsandimages.com>
To: php-general@lists.php.net <php-general@lists.php.net>
Date: Tuesday, June 13, 2000 11:18 AM
Subject: [PHP-GENERAL] Refreshing
>Is there a setting in PHP that would allow me to force a page to be
>refreshed each time it is viewed.
>
>Or is this something that I will need to do with javascript or some
>other form of code?
>--
>
>Phillip S. Baker
>
>phillip@wordsandimages.com
>Words & Images, Inc.
>1535 Seabright Avenue, Suite 100, Santa Cruz, CA 95062
>Direct Line (831) 420-2641 / Fax (831) 458-0808
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
>For additional commands, e-mail: php-general-help@lists.php.net
>To contact the list administrators, e-mail: php-list-admin@lists.php.net
>