Web Hosting Forum | Lunarpages


*
Welcome, Guest. Please login or register.
Did you miss your activation email?



Login with username, password and session length
February 09, 2012, 08:19:11 PM

Pages: [1]   Go Down
  Print  
Author Topic: Fill Frame with random or selected HTML or WORD content  (Read 1159 times)
burghboyb
Newbie
*
Offline Offline

Posts: 2


WWW
« on: May 07, 2010, 05:16:58 AM »

I have a requirement to display one of 100 HTML or MS-Word pages inside a web page.  I'd like to have the content show up automatically, or when #37 is selected.  Right now I have them numbered 1-31 and a script launches the day of the month # - but that only covers 1/3 of my content.

Of course I could use a grid with #'s 1-100 and have the user select a hyperlinked # but I was hoping to avoid that.

The page in quesiton is: http://www.pittsburghbridge.org/JimmySez.htm

Any ideas?

Thanks!

bb
Logged

William H Holt
wektech
Master Jedi
*****
Offline Offline

Posts: 1031



WWW
« Reply #1 on: May 07, 2010, 08:29:07 AM »

What are you using for your scripting?  It is quite easy to create a random number generator in just about any scripting language.
Logged

burghboyb
Newbie
*
Offline Offline

Posts: 2


WWW
« Reply #2 on: May 09, 2010, 01:08:47 PM »

I used a freebie script generator from an online source, and dropped that inside of Front Page code.  I am not too sophisticated, was looking for something already prepared.

Thanks for trying to help me. hug me
Logged

William H Holt
MrPhil
Berserker Poster
*****
Offline Offline

Posts: 5083



« Reply #3 on: May 09, 2010, 02:40:25 PM »

If you drop some PHP code into your page, within <?php ... ?> delimiters, you can use its random number generator to pick one of a number of pre-built chunks of text and HTML code (page segments) kept in separate files. I presume your site is currently HTML; you would either have to specify that .html/.htm files are parsed as PHP, or change your file extension to .php. To be honest, static HTML pages like you probably have are very limited. You'll want to get into dynamic pages built on the server with a language like PHP anyway.

If you want to use Javascript's random number generator, you'd have to package all the alternate content into the page (as, say, array elements) and then pick which one to use on the fly at the browser. If each alternate content is only a few words, this wouldn't be too bad, but if it's a good sized chunk of HTML text and code (or there are a lot of them), it would really bloat your page size and slow down loading.
Logged

Pages: [1]   Go Up
  Print  
 
Jump to: