I am looking for an ad roater script that will serve ads, off of a text file then I can just place the include where I want the ads to rotate thanx
You can use this code in the area you want the ad: <?php $fcontents = join ("", file ("banner_ads.txt")); $s_con = split("~",$fcontents); $banner_no = rand(0,(count($s_con)-1)); echo $s_con[$banner_no]; ?> PHP: and create a text document named "banner_ads.txt" in the same directory. In that text document include the following text. YOUR FIRST AD CODE ~ YOUR SECOND AD CODE ~ YOUR THIRD AD CODE ~ etc..... Code (markup):
hey cool script!! i tried and its really cool! i was wondering though how do you make it so it favors one ad over the other. so say I have two banners i want to show, banner 1 and banner 2. how do i have banner 1 show maybe like 60% of teh time and banner 2 like 40% of the time? thanks for the help!
What about just making three ads with two the same? Won't hit your percentages exactly but ... If you want it exact make ten ads, six of one, four of the other.