View Single Post
Old 2023-09-15, 05:54 AM   #5
Greenguy
The Original Greenguy (Est'd 1996) & AVN HOF Member - I Crop Pics For Thumbs In My Sleep
 
Greenguy's Avatar
 
Join Date: Feb 2003
Location: Blasdell, NY (shithole suburb south of Buffalo)
Posts: 41,754
Send a message via ICQ to Greenguy
Quote:
Originally Posted by jollyhumper View Post
I've messed around with this one, but I can't make it work.
What I want it to do:
Let's say I have 3 files named:
01.txt
02.txt
03.txt

Can I make php pull one of them by random?

J
I KNOW THIS!!!

Create a text file with what you want pulled randomly - for example:
https://www.link-o-rama.com/greenguy...nks-header.txt
(simple banner rotator)

Make sure there is no extra empty line or return at the end.

Then put this coding on your page:

Code:
<?php
$file = "/home/greenguy/domains/link-o-rama.com/public_html/greenguy/includes/mlinks-header.txt";
$banners = file($file);
srand((float) microtime() * 1235689);
$selected = array_rand($banners);
$SelBanner = trim($banners[$selected]);
if ($SelBanner=="") {
$SelBanner = trim($banners[0]);
};
echo $SelBanner;
?>
Change /home/greenguy/domains/link-o-rama.com/public_html/greenguy/includes/mlinks-header.txt to the location on your server.

That's running the top banner on here.

(thank you cd34)
__________________

Promote POV Porn Cash By Building & Submitting Galleries to the Porn Luv Network
Greenguy is offline   Reply With Quote