|
Posted by Jonathan N. Little on March 21, 2008, 11:46 am
Please log in for more thread options Geoff Cox wrote:
> On Fri, 21 Mar 2008 09:40:41 -0400, "Jonathan N. Little"
>
>> A much simpler method would be a link randomizer.
>>
>> <?php
>>
>> $links = array('a.html','b.html','c.html','d.html');
>> $last=count($links)-1;
>> $link=$links[rand(0,$last)];
>>
>> echo "<a href=\"$link\">Mystery Tour</a>";
>>
>> ?>
>
> Thanks Joanathan,
>
> when I use the above I get
>
> Mystery Tour"; ?>
>
> I must be missing something?
>
1) your server must support php
2) the page is named with a ".php" extension (normally for most server
setups)
3) attention to the escaped quotes
echo "<a href=\"$link\">Mystery Tour</a>";
^ ^
or concatenate with single quotes
echo '<a href="' . $link . '">Mystery Tour</a>';
--
Take care,
Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
|