Refreshing a page with PHP
Posted by FloppyShoe (FloppyShoe), 2 March 2004Hi 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,
Posted by Chris_Isaac (Chris Isaac), 2 March 2004hi
if 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:
Posted by admin (Graham Ellis), 2 March 2004I've put up a demo page at http://www.wellho.net/demo/clockpage.php4. The source code of the page is:
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.
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: firstname.lastname@example.org • WEB: http://www.wellho.net • SKYPE: wellho