dcsimg
www.webdeveloper.com
Results 1 to 7 of 7

Thread: Random txt files

  1. #1
    Join Date
    Oct 2006
    Posts
    11

    Random txt files

    I want to generate a random .txt or .rtf file's contents onto a section of my website on every reload or button press, much like a random image. Is this even possible? And if it is, how do I do it?

  2. #2
    Join Date
    Jan 2005
    Location
    Frankfort, KY, USA
    Posts
    6,167
    Do you mean sort of like one of those random quote things, or do you mean something else?

    You can do that with javascript and an array: http://www.hotscripts.com/JavaScript...ext/index.html

  3. #3
    Join Date
    Oct 2006
    Posts
    11
    Well, what I want to do is to write a bunch of different scenes of a story (sort of, but for our purposes it works), and I want a random scene to be displayed in the box on every reload.

  4. #4
    Join Date
    Oct 2006
    Posts
    11
    That script works, but only for one paragraph at a time it seems.

  5. #5
    Join Date
    Jan 2005
    Location
    Frankfort, KY, USA
    Posts
    6,167
    Might be better to use a database and some asp or php to pull that type of stuff up.

  6. #6
    Join Date
    Oct 2006
    Posts
    11
    Know where I could find a How-To for that?

  7. #7
    Join Date
    Oct 2006
    Posts
    11
    I might have found a useful program, but I don't know the first thing about using a .php file. Where do I save it, and how do I let my html document refer to it?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles