It would create a really bulky page, and be limited later, especially for changing the values later on.
It is a bit easier to code... might work for your purposes. Integrating with a database or maybe text file could help you later on... something to think about later.
Basically... you could do something like this:
PHP Code:
Put this at the top of your page:
<?php
$array[0] = "this is a quote";
$array[1] = "something else";
//add as many as you want, increasing the number each time.
$n = rand (0, 1); //Change the "1" to the highest value above.
?>
This outputs the quote.
Put it where you want the quote to go on your page:
<?php
echo $array[$n];
?>
The top part assigns values to an array then chooses a random number, assigning it to $n.
The bottom part takes that $n value and chooses the corresponding part of the array.
If you need more than just the quotes, you can use more than one array, assigning in the same exact way, just using something different than "array" in $array[0]. Like $quote[0], etc.
Then, when displaying them, just display all the variables there.
Note: Note: As of PHP 4.2.0, there is no need to seed the random number generator with srand() or mt_srand() as this is now done automatically.
that is from php.net. If you happen to be using a php version earlier than 4.2, you WILL need to seed the random number generator.
Bookmarks