Random link coding
Started on the old forum in January 2010 · view the original in the archive · old links redirect here
wap-lord wrote: anyone have these coding randomlink.php or randomlink.txt
this is what i use for my adverts
$quotes[] = "LINK GOES HERE";
$quotes[] = "LINK GOES HERE";
$quotes[] = "LINK GOES HERE";
$quotes[] = "LINK GOES HERE";
$quotes[] = "LINK GOES HERE";
$quotes[] = "LINK GOES HERE";
$quotes[] = "LINK GOES HERE";
$quotes[] = "LINK GOES HERE";
$quotes[] = "LINK GOES HERE";
$quotes[] = "LINK GOES HERE";
$quotes[] = "LINK GOES HERE";
$quotes[] = "LINK GOES HERE";
$quotes[] = "LINK GOES HERE";
srand ((double) microtime() * 1000000);
$randomquote = rand(0,count($quotes)-1);
echo " ".$quotes[$randomquote]."<br/></p>";
ok make a randomlink.php
put this in it
<?php $urls = array("http://site.com" ,"http://site1.com","http://site2.com"); //set the text links $text = array("java Games " ,"Downloads" ,"New Downloads","chat and downloads Free "); srand(time()); //set the number in (rand()%3); for however many links there are $random = (rand()%3); echo ("<a href = \"$urls[$random]\">$text[$random]</a> "); ?>
and include this file at any page you can add/remove more links and txt
left wap stuff
wap-lord wrote: the $test not showing
Friend, i have this script . Just look here.
step 1.
creat a *.txt file with name msg.txt or any other name's which you want
Now just copy and past this code in your msg.txt file
::<a href="http://HeArT.wen9.com">HeArT.wen9.com</a>
::<a href="http://FileWap.co.cc">FileWap - Shere ur file</a>
::<a href="http://Findz.co.cc">Findz - Toplist</a>
::<a href="http://CodingForum.freehostia.com">Coding Forum!</a>
::<a href="http://sexindia.wen9.com">Free Hot Video!</a>
::<a href="http://Im4ChaT.co.cc">Chat site</a>
step 2.
after this just put this code where you want to show yor rendom link
$xfile = @file("msg.txt");
$random_num = rand (0,count($xfile)-1);
$udata = explode("::",$xfile[$random_num]);
echo $udata[1];
Now enjoy this script
a simple code for lavair or same sites
core.php
function random_links() { $sec = date(s);
if($sec <2) { echo "<a href="http://site url ">link name </a> "; } else if($sec <5) {
echo "<a href="http://site url ">link name </a> "; }
else if($sec <8) {
echo "<a href="http://site url ">link name </a> ";
}
else if($sec <11) {
echo "<a href="http://site url ">link name </a> ";
}
else if($sec <13) {
echo "<a href="http://site url ">link name </a> ";
}
u can add more and more link by changing $sec<.....
use random_links() to show random links on any page .......
ShaK!L AhammeD
Sklifbd.CoM +88-01730039272