Jump to content

Archived

This topic is now archived and is closed to further replies.

lonsalot

Help on how to include a page based on the date??

Recommended Posts

Can anybody show me how to include a page based on the date.  I would like to have a different page depended on what day of the year it is.  So the code should include Leap Years too.  Has anybody seen this done before with PHP.  I can't imagine that it's that hard.  I just am not familar that much with PHP.  If there is a link to a tutorial that is similar to this, could you let me know.

Thanks,
Lonsalot

Share this post


Link to post
Share on other sites
Example:
[code]<?php
$date = date("d.m.Y"); // dd.mm.yyyy
$date1 = explode(".", $date);
/*echo
$date1[0] // dd
$date1[1] // mm
$date1[2] // yyyy
*/
if ($date1[0] == "14" && $date1[1] == "08" && $date1[2] == "2006")
{
echo "There";
}
?>[/code]

Share this post


Link to post
Share on other sites
[code]include date('Md') . '.php';[/code]

This will include "Aug14.php" today

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.