Hi, I did multiple searches on the forum but i didn’t find any related topics, so please pardon me if this question was asked a lot.
I have 7 images that I have set for each day of the week, Monday, Tuesday etc for a blog that i’m trying to design. but I think it would be a hassle if i were to use the php made for dates of the month that i found earlier on this site since i have to reassign all images to individual dates. I’m not even sure if php works for blogs because i’m not sure what it is anyway.
Can anyone guide me? Thanks.
That will output a number representation of the day of the week: 1 (for Monday) through 7 (for Sunday)
So header1.jpg would be Monday’s header.
Thanks but I do not quite understand this. Where am I suppose to place this code? In the <head></head> area? And is that the only line required? Where would my image source be placed?
Would this work?
I’m sorry, I’ll simplify:
Here is basic PHP:
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:
I make an image for each day of the week and name them:
Now I can change my HTML code to:
And that PHP code will be replaced by a number, completing the call for the image.
(likewise, this can be done in CSS too:
Thank you, it seems plausible, but since I’m using this for a blog i can only use images that are hosted on the net itself, like photobucket, I made several images and labeled them with numbers as you suggested but I do not think the code would work like this,
Is it possible to incorporate images from images from the web? or is it strictly to hosted images in our domain only thus it can;t be used on blogs?
There is a way around this but the best way would be to host your images somewhere.
Just keep that going for 7 days.
Don’t forget to escape the " (speech marks) like " or php will error.
You must be logged in to reply to this topic.