Welcome to WebmasterWorld Guest from 220.127.116.11
Forum Moderators: incrediBILL
What would be the HTML coding that I would use?
Is there a certain type of database that I should use?
Also, would the text have to be a gif/jpeg file vs. plain HTML text?
And would the files be shown in a random order, or would they be shown sequentially?
If they would be shown randomly, would the page still not repeat an image until after it has shown all of the images in the database?
Some limitations of the script as posted were lack of support for ALT and TITLE tag attributes among other things, so surf around the web for alternatives. There are lots out there in every programming language available.
With server-side solutions, I would think that the page would frequently remain cached. In that case either the browser would not query the server at all, or the server would return a 304 code. You'd have to test it out to see exactly how the script behaves. Anyway you could override the cacheing by using a meta tag to expire the page.
There really are a lot of ways to go about that, but before jumping into research mode on a particular one, I would take a look at what your hosting provider has loaded on the server. Perl, PHP, or what?
document.write("<img src='graphics/" + Math.floor(Math.random() * 4) + ".jpg'>");
I have 4 images named 0.jpg, 1.jpg, 2.jpg and 3.jpg all in a directory called graphics/. Need a 1000 images instead of 4? Just change the 4 to 1000 and name your images 0.jpg - 999.jpg.