Greenguy's Board


Go Back   Greenguy's Board > Programming & Scripting
Register FAQ Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
Old 2005-03-11, 09:02 AM   #5
Useless
Certified Nice Person
 
Useless's Avatar
 
Join Date: Oct 2003
Location: Dirty Undies, NY
Posts: 11,268
Send a message via ICQ to Useless
Quote:
Originally Posted by security_man
i would suggest phpadsnew
So would I. Once you get the hang of phpadsnew you can control an amazing amount of advertising with it.

But if you are looking for something simple that doesn't require databases, you can employ a tiny script that I found here at GG&Jim's.

Place this PHP statement on your page where you want your adverstising to appear:

<?php
$file = "bannerlist.txt";
$banners = file($file);
srand((float) microtime() * 1235689);
$selected = array_rand($banners);
$SelBanner = trim($banners[$selected]);
if ($SelBanner=="") {
$SelBanner = trim($banners[0]);
};
echo $SelBanner;
?>

You'll notice that it pulls it's info from a file called bannerlist.txt. So make a text document with that name and upload it to the same directory as the page with the PHP code above. Put each separate banner, text link, or whatever on its own line. It can pull in entire tables, just make sure you get rid of any carriage returns so that the entire table is on one line on bannerlist.txt.

Each banner or link will appear randomly with each page refresh. Here's a page that uses that code to control the banners before the listings: http://www.filthyearl.com/hot-babes/
This is the bannerlist.txt for that page:
http://www.filthyearl.com/hot-babes/bannerlist.txt

And to answer your question about where to store banners, be creative in naming your banner directory or place them any image folder. You really shouldn't use the term 'banner' in your exposed page code. A lot of surfers are using ad blocking software that will block any image or link with that term.
__________________
Click here to purchase a bridge I'm selling.
Useless is offline   Reply With Quote
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 06:56 AM.


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