SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    Non-Member spdrcr's Avatar
    Join Date
    Sep 2000
    Location
    Oklahoma City, OK
    Posts
    214
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's me again and I was wondering if anyone knows of a script that can produce a random quote or message? I know they exist cause I've seen them before, just can't remember the sites i've seen them on. If anyone can help me out here I would appreciate it..

    Thanks

  2. #2
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Since you didn't specify what language you wanted the script in, here is a list of results in Javascript:

    http://www.hotscripts.com/JavaScript...g/Random_Text/

    That is the simplest way to get the result you want as it requires nothing more than a Javascript enabled browser. However, a more efficient way to get this effect would be to use a Server Side language such as PHP or ASP. That way you don't have to rely on the user's browser for the randomization to work.

    You can also find PHP and ASP scripts on that same site.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  3. #3
    Say WHA?! goober's Avatar
    Join Date
    Sep 2000
    Location
    United States
    Posts
    1,921
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have a script like this..I customized it. I have one for random quotes and one for music.

    Ask me for either one..i'd be happy to provide. it already has like 50,000 quotes there too.
    Sean Killeen [LinkedIn] [Twitter] [Web]

    Warning: Reality.sys corrupted. Universe halted. Reboot? (Y/N)

  4. #4
    PHP Developer W1LL's Avatar
    Join Date
    Apr 2001
    Location
    Leicester, UK
    Posts
    459
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    A script I made earlier:

    <html>
    <body>

    <script language="JavaScript">
    var a = (Math.round(Math.random()*4));
    var b = new Array();
    b[0] = "Quote number one";
    b[1] = "Quote number two";
    b[2] = "Quote number three";
    b[3] = "Quote number four";
    b[4] = "Quote number five";
    var c = b[a];

    document.write("<p><font face='Verdana' size='1'>"+c+"</font></p>");
    </script>

    </body>
    </html>

    This is set to five quotes. To set to more than 5 just change the number in red to one less than the number of quotes, and add more values in the array (e.g., b[5] = "Quote number six";.)

    - Will


Bookmarks

Posting Permissions

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