Show something based on date
Moderator: General Moderators
Show something based on date
I have bits of php scatered on my site, and I was wondering how to show an image and text on a certain date. Any help would be good; thanks.
-
seeker2921
- Forum Contributor
- Posts: 120
- Joined: Sat Mar 22, 2003 7:10 pm
- Location: Wiesbaden Germany
- Contact:
This is the code I use on my site to show an image with the date on the top of my page, Im use you can use it and custmize it for your needs..
Code: Select all
<?
$monday=("/htm/images/date/monday.gif");
$tuesday=("/htm/images/date/tuesday.gif");
$wendnesday=("/htm/images/date/wednesday.gif");
$thursday=("/htm/images/date/thursday.gif");
$friday=("/htm/images/date/friday.gif");
$saturday=("/htm/images/date/saturday.gif");
$sunday=("/htm/images/date/sunday.gif");
$zone=("pst");
$img_date=date("w");
$time=date(" h:i a ");
$date=date("F j, Y");
if($img_date=="0")
{
print("<img src="$sunday"> ".$date.$time.$zone);
}
if($img_date=="1")
{
print("<img src="$monday"> ".$date.$time.$zone);
}
if($img_date=="2")
{
print("<img src="$tuesday"> ".$date.$time.$zone);
}
if($img_date=="3")
{
print("<img src="$wednesday"> ".$date.$time.$zone);
}
if($img_date=="4")
{
print("<img src="$thursday"> ".$date.$time.$zone);
}
if($img_date=="5")
{
print("<img src="$friday"> ".$date.$time.$zone);
}
if($img_date=="6")
{
print("<img src="$saturday"> ".$date.$time.$zone);
}
?>