I need someone to help me out on my script. The script contain a index.php and a site.php http://www.miny.info/b1Pl606by My file index.php is catching what's in site.php I want to have on main page clickable links now it only show the text i add in site.php ( $quotes[]='http://google.com'; $quotes[]='http://gogole.ca.com'; ) Where can i add in index.php or site.php a line of code that thoses random links showing on main page would be clickable Cheers
<?php session_start(); $links = array( "http://www.google.com", "http://www.msn.com", "http://forums.digitalpoint.com" ); //add a new link for the banner to a new line in the same format as above $text = array( "Google", "MSN", "DP" ); //add a new text in the same format as above //-------- DO NOT EDIT BELOW THIS LINE---------- $count = count($links) -1; $randnum = mt_rand(0,$count); if ($randnum == $_SESSION['randnum']) { $randnum = mt_rand(0,$count); } $_SESSION['randnum'] = $randnum; echo '<a href="'.$links[$randnum].'">'.$text[$randnum].'</a>'; ?> Code (markup): That will do what you want. Code adapted from an image rotator in my blog