=?iso-8859-1?Q?Chuck_=ABBeyondFusion=BB?=
Guest
Re: php random quote or another way?
Did you publish the page with a .php file extension?
pagename.php rather than pagename.html
As Bert said, you use a Ctrl+T in a text box and then position the text box
where you want the script to execute.
--
Chuck Joslin
BeyondFusion.com - Your Fusion Community
www.beyondfusion.com
Register domain names at www.awavedomains.com
"Ian Shere" <ian@tarzandesign.co.nz> wrote in message
news:g2s0th$oi34@flsun90netnews01.netobjects.com.. .
> Found a great little piece of coding that I'd like to use (I basically
> wanted a random quote popping up on my homepage). What I found was a
> piece of PHP coding but I cannot figure out how to use it on my page. I
> have tried inserting HTML here there and everywhere but nothing shows up
> when I run the page (even publishing remotely). Code is as follows:
>
> <?php
> $quotes = array(
> 'Impossible is a word to be found only in the
> dictionary of fools.<br />— Napoleon Bonaparte',
>
> 'A person who never made a mistake never tried any
> thing new.<br /> — Albert Einstein',
>
> 'Show me a thoroughly satisfied man and I will show
> you a failure.<br />— Thomas A. Edison',
> );
>
> /*
> generate a random number between zero
> and the number of quotes minus one
> */
> $rand = rand(0, (count($quotes)-1));
>
> // output the random quote
> echo $quotes[$rand];
> ?>
>
> What am I doing wrong? Or does anyone have a better/easier way to do
> this? JS maybe?
>
> TIA
>
> Ian