PDA

View Full Version : Poem of the Day help



alcinoe
October 10th, 2008, 02:21 AM
Hi,
I would like to put a poem of the day link with a picture on the main page of my site. A particular poem must be shown on a particular date - the poems are all seasonal.
I have 366 seperate web pages, one for each poem.

I want to get the date from the users computer, and show the correct picture and link on the main page.

Can anyone point me to a tutorial as to how to do this? I was thinking that PHP and MySQL might be the best way to accomplish this, with a database with dates, links, and links to the pictures (which have to be resized), but I can't find any tutorials on this particular subject.

If anyone has any advice, please let me know.

Thanks, Elizabeth

jwilliam
October 13th, 2008, 04:51 PM
A quick and dirty way would be to name all your poem pages and images with numbers (0 - 365). Then use php's date() function to get the day of the year (date('z') will return 0 - 365). Use that number to show the right image and link to the right page.