PDA

View Full Version : How to refresh an image when page refreshed?



allan4698
04-19-2010, 03:52 AM
Hi there,

I need to refresh an image every time the page is refreshed. I mean at the cornor of the page there is an image displayed. Every time the page refreshed the image will be changed to next one. Any idea how to do it will be appreciated. Thanks in advance.

djr33
04-19-2010, 04:19 AM
Do you want the image to be in a sequence or random?
It will be much easier to do this in a random order:
Use Javascript to randomly pick an image when you load or use a server side language (like PHP) to pick a random image's URL for the <img> tag when generating the page.

You can make it in a certain order if you'd prefer and this means tracking what was last shown: in Javascript you must use cookies; in PHP (etc) you can use cookies or sessions.