• 0

Random Links


Question

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

  • 0

--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

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.