| |||||||||||
| |||||||||||
Refreshing a page with PHP Posted by FloppyShoe (FloppyShoe), 2 March 2004 Hi everyone. I am a relative newbiw to the world of PHP and programming in general.I am writing a page that shows the date (and sometimes the time) on a page and my question is this : Is there a way I can get the page to refresh itself, say every hour or so, so that if someone leaves the page open over-night, it will display the current date when they come back to the computer the following day rather than still displaying the date of the previous day. I hope that makes sense and more importantly that someone will be able to help!! Many thanks in advance, FloppyShoe. Posted by Chris_Isaac (Chris Isaac), 2 March 2004 hiif you use the following at the top of the script it will force the browser to reload the page rather than use a cached copy: Code:
Posted by admin (Graham Ellis), 2 March 2004 I've put up a demo page at http://www.wellho.net/demo/clockpage.php4. The source code of the page is:Code:
Our server is in West Coast USA, so the report is Pacific time; you can vary that and should do so to suit the timezone of most of your users. Chris's header shouldn't be necessary on a PHP page if the server is properly set up (but it would do no harm). On an HTML page that you change frequently, it could be a good addition. This page is a thread posted to the opentalk forum
at www.opentalk.org.uk and
archived here for reference. To jump to the archive index please
follow this link.
|
| ||||||||||
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho |