What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » Random Quote into HTML

Random Quote into HTML
Author: Message:
Joe
Senior Member
****

Avatar

Posts: 950
Reputation: 30
35 / Other / Flag
Joined: Mar 2004
O.P. Random Quote into HTML
I want to make a line of text randomly selected out of preset choices... like sloganizer does with images... but i just want a line of text to do this. How would I go about this?
[Image: holidayssigei2.jpg]
03-16-2006 07:33 PM
Profile E-Mail PM Find Quote Report
ShawnZ
Veteran Member
*****

Avatar

Posts: 3146
Reputation: 43
32 / Male / Flag
Joined: Jan 2003
RE: Random Quote into HTML
<script>quotes = new Array();void(document.write("<div id=\"quotespace\"></div>"));

    quotes.push("a");
    quotes.push("b");
    quotes.push("c");
    quotes.push("d");
    quotes.push("e");
    ...etc

document.getElementById("quotespace").innerHTML = quotes[Math.round(Math.random * quotes.length)]</script>
Spoiler:
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
03-16-2006 07:38 PM
Profile PM Web Find Quote Report
henri
Junior Member
**


Posts: 25
– / Male / –
Joined: May 2005
RE: Random Quote into HTML
Well You Can Do It In Php Here Is An Example
(This Has Been Tested On Php 4 And 5)
code:
<?php
$tip = rand(1,2); //Change The 2 To The Number Of Tip`s

if ($tip == 1) { //Tip 1
echo '<!--Insert Tip #1 Here-->';
}
if ($tip == 2) { //Tip 2
echo '<!--Insert Tip #2 Here-->';
}
?>

If You Have Any Problems Pm Me.

This post was edited on 03-16-2006 at 07:43 PM by henri.
[Image: henri.png]
03-16-2006 07:41 PM
Profile E-Mail PM Find Quote Report
Eljay
Elite Member
*****

Avatar
:O

Posts: 2949
Reputation: 77
– / Male / –
Joined: May 2004
RE: Random Quote into HTML
tbh in php it should be...
code:
<?php
$quotes = array('Quote 1', 'Quote 2');

echo $quotes[rand(0, count($quotes)-1)];
?>
03-16-2006 07:45 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On