Page 1 of 1

Show something based on date

Posted: Sun Nov 23, 2003 4:01 pm
by theblob
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.

Posted: Sun Nov 23, 2003 6:30 pm
by infolock
not sure what you mean though. what dates are you talking about? How are you storing the dates, and how are they set ? are you storing them in a database? please be more descriptive of your issue, and maybe post some code for us to go with.

Posted: Sun Nov 23, 2003 6:33 pm
by seeker2921
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);
 }
?>