Heres a script we've build to show an images in between 2 exact dates ... hope it helps !
<?php
$complete_url = "http://www.TheLinkToWhatEverYouWant.php";
?>
<?
$array = array(
//Halloween//
"http://YourImage/halloween.gif"=>array("10/31/2005", "10/01/2005"),
//Action de grâce //
"http://YourImage/action.gif"=>array("10/10/2005", "10/11/2005"),
//Fin de l'heure avancé //
"http://YourImage/recule.gif"=>array("10/30/2005", "10/31/2005")
);
//So imagename.gif would be shown between 12/05/2005 and 12/25/2005 and imagename2.gif would be show between 12/25/2005 and 10/30/2006
// here's the code to display the right image:
$showDefault = true;
foreach($array as $key=>$value) {
$beginDate = $value[0];
$endDate = $value[1];
if((strtotime($beginDate) <= time()) && (strtotime($endDate) >= time())) {
$showDefault = false;
echo("<a href='$complete_url' ><img src=\"$key\" border='0'></a>");
}
}
if($showDefault) {
echo("<a href='$complete_url'><img src=\"YourImageByDefault/new_logo_toile_quebec.gif\" border='0'></a>");
}
?>