Display image depending on week
This example will display a different image every week , you could use this for advertising etc .
Here is the code for this example
<?php
$week = date("j");
//this is your image for week one
if ($week <=7 )
{
$image = "aspbanner1.gif";
}
//this is your image for week two
else if ($week >=8 && $week <=14)
{
$image = "aspbanner2.gif";
}
//this is your image for week three
else if ($week >=15 && $week <=21)
{
$image = "aspbanner3.gif";
}
//this is the image for all other days
else
{
$image = "aspbanner4.gif";
}
//display image
echo "<img src = \"$image\" >";
?>
And this displays the following banner in this case