View Full Version : How to make something.gif show a random image?
Magic2K2
September 19th, 2001, 20:04
I want to have a file that I can call simply as blahblah.gif and I want it to show a random image from a set of images I have. Is it possible to do this?
bigperm
September 19th, 2001, 22:36
Not that I know of... you will have to use a random image script.
Canuckkev
September 19th, 2001, 22:45
Perl or javascript. No way with just HTML. PHP would work too I guess. Any of these languages interest you in using, just go search around. A very simple script.
jm4n
September 19th, 2001, 23:36
No way with just HTML.
Sounds like a challenge to me :) Okay, maybe not just plain HTML, but you could conceivably do this with JavaScript...
Anyway, I recommend using PHP. You can name your PHP script with a .gif extention, and if using Apache, simply have Apache parse it as a PHP script. PHP can directly output image content, or better yet simply open the image file and output its content directly (with proper headers).
In any case, don't forget to send no-cache headers, otherwise the browser may cache it and re-display the same image...
Powered by vBulletin® Version 4.1.7 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.