Home › Forums › CSS › Image rotation by days of the week? › Re: Image rotation by days of the week?
June 16, 2009 at 3:19 am
#59110
AshtonSanders
Participant
I’m sorry, I’ll simplify:
Here is basic PHP:
Code:
This will print out a number between 1 and 7 depending on the day of the week: 1 (for Monday) through 7 (for Sunday)
In general: this is PHP, so it needs to be on a PHP page (not in a .css file)
So let’s say here’s the HTML code for my image:
Code:
I make an image for each day of the week and name them:
image1.jpg
image2.jpg
image3.jpg
image4.jpg
etc…
Now I can change my HTML code to:
Code:
.jpg” />
And that PHP code will be replaced by a number, completing the call for the image.
(likewise, this can be done in CSS too:
Code:
.jpg’)”>
etc.