Home Advanced Code Randomize Your Button Friends

Randomize Your Button Friends

E-mail Print PDF
Got alot of friends you link to? Want to randomize their small buttons? You can randomize anything really with this script. Check it out... Have some fun!

Code:
<?
$Buttons = 5; // # of button to show
$Img[] = "<a href='http://www.friend1.com'><IMG src='images/1.gif'></a>";
$Img[] = "<a href='http://www.friend2.com'><IMG src='images/2.gif'></a>";
$Img[] = "<a href='http://www.friend3.com'><IMG src='images/3.gif'></a>";
//over and over like that ^^

srand ((float) microtime() * 10000000);
$Keys = array_rand($Img, 5);

for($K = 0; $K < $Buttons; $K++){
echo "".$Img[$Keys[$K]]." <br> ";
}

?>
There you have it, everything inside the " and " for the $Img =.... will be what is random, it can be text, images, links.

Then, the $Button = 5; the 5 is how much of those random things are going to be shown.
 

Domain Names

Sample image .com .info
.mobi .net
.org .tv .us
.biz .ws .name
.am .at .be .cc .cn .de .eu
.fm .jobs .jp .ms .nu .nz
.tc .tw .uk .vg .ASIA .ME

Website Hosting

Sample image We're the affordable, reliable place to host your site. And unlike the competition, there's no set up fee and no annual commitment.

24/7 Support

Sample image Our highly trained, courteous support staff is waiting to help. We'll resolve any issue to your complete satisfaction.