I have seen many scripts that rotate a banner in one place, but I am looking for something that will rotate several banners each time the page is refreshed. Example: I have a column with 8 ads displaying. Each time the page loads, those 8 ads will be in a different order. Any help would be great. Thanks!
you could do that with a very simple php script. if you want a packaged deal, phpadsnew seems to be popular. php code if you want: <? $ad[0] = "your ad code here"; $ad[1] = "your ad code here for ad #2"; $ad[2] = "your ad code here for ad #3"; // continue to $ad[8]. or higher if you desire. shuffle($ad); foreach ($ad as $adcode) { echo $adcode; } ?> Code (markup):
phpadsnew is the best free banner management script i know off Maybe you should take a look at that. Didier
phpadsnew has a fairly hefty cost in terms of setup time and processor overhead compared with that cool script disgust posted... disgust's processor will only work in php pages, though! (as in, a page ending with .php) where phpadsnew etc. will work in ANY place. Lots of lousy software in this arena.
I really wanst looking for something that complex. Just a small script that will rotate the images upon page load.
Actually it comes standard with many hosting packages. Just 1-click and it is installed. After that you just have to paste the php code into your pages. So unless you have a few hundred pages where the code must be on, it is really a snap to install this. Didier
you would want to have $ad[0] = '<a href="http://www.site.com/"><img src=http://www.yoursite.com/ad.jpg></a>; Code (markup): or something similar. or... <? $ad[0] = "../images/ads/sponsor.jpg"; $ad[1] = "../images/ads/myspace.jpg"; $ad[2] = "../images/ads/bom.jpg"; // continue to $ad[8]. or higher if you desire. shuffle($ad); foreach ($ad as $adcode) { echo '<img src="'; echo $adcode; echo '">'; } ?> Code (markup):
is it really that hard to figure out? ;-) <? $ad[0] = "../images/ads/sponsor.jpg"; $ad[1] = "../images/ads/myspace.jpg"; $ad[2] = "../images/ads/bom.jpg"; // continue to $ad[8]. or higher if you desire. shuffle($ad); foreach ($ad as $adcode) { echo '<img src="'; echo $adcode; echo '"><br>'; } ?>
OK, LOL. I have everything done now except the linking. Can someone make this so id opens a link (when clicked) in a new window? I tried adding the above code with no luck......Thanks in advance!
this really shouldn't be that hard <? $ad[0] = "../images/ads/bom.jpg"; $ad[1] = "../images/ads/myspace.jpg"; // continue to $ad[8]. or higher if you desire. shuffle($ad); foreach ($ad as $adcode) { echo '<a target="_blank" href="http://www.site.com"><img src="'; echo $adcode; echo '"></a><br>'; } ?> Code (markup):