Darran Posted April 9, 2003 Share Posted April 9, 2003 A mate of mine needs to make a link random, so that it points to a different url each time, please can you tell me so that I can tell him thanks. :D Link to comment Share on other sites More sharing options...
0 Rusty.Metal Posted April 9, 2003 Share Posted April 9, 2003 --website.txt http://google.com http://neowin.net http://something.com randome link.php <?php $textfile ="website.txt"; // change to the filename/path of your site list $webs = file("$textfile"); $web = rand(0, sizeof($webs)-1); echo "<a href=\""; echo $webs[$web]; echo "\"> Randome Site </a>"; ?> Link to comment Share on other sites More sharing options...
0 Darran Posted April 9, 2003 Author Share Posted April 9, 2003 Thanks, ;) Link to comment Share on other sites More sharing options...
0 Rusty.Metal Posted April 9, 2003 Share Posted April 9, 2003 n/p Link to comment Share on other sites More sharing options...
Question
Darran
A mate of mine needs to make a link random, so that it points to a different url each time, please can you tell me so that I can tell him thanks. :D
Link to comment
Share on other sites
3 answers to this question
Recommended Posts