View Single Post
Old 2003-12-12, 10:09 AM   #2
AcidMaX
Programming till my fingers bleed.
 
AcidMaX's Avatar
 
Join Date: Aug 2003
Location: Michigan
Posts: 876
Could easily be done with some php code, especially if its text links etc.

Let me provide something simple although this isnt tested but should work

PHP Code:
<?php
// FILE TO PULL FROM
$links_file "amateur.txt";

$links join(''file($links_file));
$alllinks split("\n"$links);

$random_link rand(0,count($alllinks));

list(
$link,$desc) = split("\|"$alllinks[$random_link]);

echo 
'<a href="'.$link.'" target="_blank">'.$desc.'</a>';


?>
Then in amateur.txt have a link|desc one per line something like:

http://www.url1.com|This chick is smoking hot
http://www.url2.com|This chick is also hot


Like I said I havnt tested the code, but I think that will work, it will just pull a random line from the text file, split the url & description on the | and spit it out.

Hope that helps.

Andy
AcidMaX is offline   Reply With Quote