Page 1 of 1

Daily load of page depending on user's computer date

Posted: Sun Oct 01, 2006 2:28 pm
by ruy.pedro@netcabo.pt
Sorry but I'm new with PHP and I thank very much if anybody can help me:
I have a site and there's a page that should be diferent depending on the day of the month.
How can I make a script that loads the right page depending on the users computer date.? I explain better: in the root of the site I have, for instance, 31 pages for the October month and the last page of September: 30September.php, 01oct.php, 02oct.php, 03oct.php, ... 10oct.php, 11oct.php... 29oct.php, 30oct.php, 01nov.php .
In my contry, today is October, 1 but in another country still is only September 30.
later, in my country still is October 1 but in Japan, for instance is now October 2
How can I make to show to the user the page corresponding to the date in his country ?
I will thank you vary much.

Ruy Pedro

Posted: Sun Oct 01, 2006 3:21 pm
by Ollie Saunders
I don't think you can reliably get information on a user's timezone. That's why on most forums timezone is something you have to set manually in a control panel so you would have to provide a similar solution.

You can pretty easily use the server time to load different pages depending on that:

Code: Select all

include date('dM');