Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

General discussion

How to display a different graphic?

Jan 15, 2006 1:43AM PST

Happy New Year to all. Hope you guys and girls had a time welcoming 2006.

I have a question which I don't know the answer to. I have seen website that displays a different graphic everytime you access the main page. I have been searching around to find out how to do this, but I have no luck. Can someone tell me if there is a software out there that will dispaly a different image everytime a visitor access my home page?

Or is the a special code that I can use to achieve this process?

The webpage will be in html format..nothing special. Should it be in php instead?

Thanks for your help.

Discussion is locked

- Collapse -
Several different approaches
Jan 16, 2006 1:34AM PST

Easiest way would probably be Javascript. Instead of a fixed filename, the filename is determined at runtime by Javascript picked randomly from an array of valid names.

If you can do server-side scripting such as PHP, you can do something similar to the Javascript approach, but more compatible since the code runs on your end.

- Collapse -
Random graphic file display
Jan 16, 2006 5:40AM PST

Thanks for responding, and much appreciated. would you happen to know of any php code that can achieve this task? What is that process refer as? I think it would be better it is server-side scripting.

- Collapse -
Well, Google is your friend...
Jan 16, 2006 3:11PM PST
- Collapse -
Random picture file
Jan 16, 2006 10:51PM PST

Once again..thanks a million for the help. I will work with the info you've provided and go from here. Thanks again.