Greenguy's Board


Go Back   Greenguy's Board > Programming & Scripting
Register FAQ Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 2003-12-12, 10:09 AM   #1
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
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:05 AM.


Mark Read
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc