View Full Version : how to load web pages by date
lobiwan
10-09-2010, 04:49 PM
I am looking for a way to have specific web pages load depending on the date. For example, the first week of the month a particular page would load and the remainder of the month another. Thanks in advance.
Beverleyh
11-04-2010, 12:11 PM
Maybe this will give you a starting point;
<?php // special date is November 1st 2010
$spec_date = '2010-11-01';
$todays_date = date('Y-m-d');
$today = strtotime($todays_date);
$special_date = strtotime($spec_date);
if ($special_date == $today)
{ ?>
<!-- put special one-day content here -->
<p>You are seeing this content because the date is November 1st 2010.</p>
<?php } else { ?>
<!-- put other content here -->
<p>Usual content.</p>
<?php } ?>
djr33
11-04-2010, 01:31 PM
You could also use the include() function to store the two pages as separate files.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.