View Single Post
Old 08-22-2006, 08:58 AM   #5 (permalink)
helloworld
Contributing Member
 
helloworld's Avatar
 
Join Date: 06-29-06
Posts: 72
iTrader: 0 / 0%
Latest Blog:
None

helloworld is liked by somebodyhelloworld is liked by somebodyhelloworld is liked by somebodyhelloworld is liked by somebodyhelloworld is liked by somebody
Save as: link.php
Code:
<? $links= array( 'http://yahoo.com', 'http://google.com', 'http://www.ebay.com' ); $random = rand(0,count($links)-1); ?>
include in the page conatining the link. "this makes it less hassle to include in multiple pages"
Code:
include ('link.php');
call the url from a link:
Code:
<a href='<?echo $links[$random];?>'>some name</a>
or

call it from a button:
Code:
<FORM METHOD="LINK" ACTION="<?echo $links[$random];?>"> <INPUT TYPE="submit" VALUE="Go to link"> </FORM>
modified version of my banner rotation script
helloworld is offline   Reply With Quote