Log in

View Full Version : Random Page Display?



ritchie2100
08-20-2010, 01:49 PM
Is there a way I could have part of my website change every time the user visits the page without using frames?

djr33
08-20-2010, 02:14 PM
You would need to use some sort of dynamic programming language. This could be just Javascript, or a serverside language like PHP or ASP.
Javascript requires that the user has javascript available/enabled so it won't always work. It also requires that the content is all loaded and then most of it is hidden and one random part is shown. This is best for very small bits of content, I think. You could also attempt to use Ajax (maybe not the best idea here) to load extra content into the page (randomly) after it had loaded-- you could even reload the entire page randomly.
For a serverside language, this would be easy (once you understand a little bit about how the language works in general), and you could make anything from a single line to the whole page random.

How much of the page needs to be random and which programming language(s) would you want to use?


Finally, one thing to remember is that this is a bad idea for search engines: if the content always changes, their stored version won't match the real content and it may lower your page's rank.
For this reason, it may be a much better idea to randomize a link on the page (a link that says "random page") rather than making a single page actually random. Does that make sense? Instead of visiting random.htm to see random content, you simply click a "random" link that has a direct link to a real page like content7.htm or content3.htm-- it's the link that changes, not the pages. This also could be done in Javascript or a serverside language. Again, Javascript would require that it can run on the user's computer. A serverside language, if possible, is usually the better choice for that reason, but maybe a little harder to use. Either way, that's not very difficult.

ritchie2100
08-21-2010, 03:03 AM
Sorry, I should've said this in my opening post.

I'm basically building a portfolio website and would like a section with an example of my work on the home page at the size of about 285 x 325 pixels. I had previously used a random image code but I would now like a description to go with it. Is there a way this could be done?

I did find an iframe code that could do this but as you said, using frames isn't a good idea for search engines so I might have to scrap this idea and go with something else.

jscheuer1
08-21-2010, 03:57 AM
http://www.dynamicdrive.com/dynamicindex14/fadeinslideshow.htm

http://www.dynamicdrive.com/dynamicindex14/swissarmy/index.htm

Either of the two above linked slide show scripts can do text and image. And they can each also be set up in manual mode without controls. And they each also have an optional random setting. So it's just a matter of which one you like. As I say, either can be set to show just one image w/description on load.

ritchie2100
08-21-2010, 05:02 PM
http://www.dynamicdrive.com/dynamicindex14/fadeinslideshow.htm

http://www.dynamicdrive.com/dynamicindex14/swissarmy/index.htm

Either of the two above linked slide show scripts can do text and image. And they can each also be set up in manual mode without controls. And they each also have an optional random setting. So it's just a matter of which one you like. As I say, either can be set to show just one image w/description on load.

This'll do nicely, cheers.