Daily load of page depending on user's computer date

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ruy.pedro@netcabo.pt
Forum Newbie
Posts: 1
Joined: Sun Oct 01, 2006 9:29 am

Daily load of page depending on user's computer date

Post 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
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post 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');
Post Reply