does anyone know of a good text link rotator script? for instance: i have an ad bar that displays 5 text links at a time, but every time a user visits the site it randomly pulls the 5 links out of a database of say 30. So each time its random AND the same link cannot be displayed twice at the same time. Anyone know of a free or $ script? or maybe someone here can make it?
I don't know of a free one, but I could write one if your site used MySQL & supported CGI scripts. However, you would have to have the ability to call the script from your pages. . . so unless you could do that (or your website was written in perl/cgi) then I don't know if it'd work.
ya i tried that already but could find anything good. most of the "link rotator" scripts would rotate the links like every 5 seconds or something, rather than every page load. other ones i found would repeat some of the ads on the same page. ednit - my page is in php, would it work? i have mysql and cgi-scripts support
You can't execute a cgi script or routine from a php script directly that I know of. You could probably make it work using frames or javascript (I couldn't, but maybe you could), though this is highly unsuggested.
PM me if you still need help with this and can't find a ready-made solution. I can code it for you. I can do it using AJAX and Javascript, and it shouldn't take too long to do.
this will work for you. just put the exact code you want rotated in banner.txt read on <? $banners = split("<!-- SPLIT -->", preg_replace("/<\?.*?\?>/", "", file_get_contents("/complete route from root to directory/banner.txt"))); echo $banners[rand(0,sizeof($banners) - 1)]; ?> PHP: First you put the above in your index.php file or whatever... Then you create a banner.txt file and include what ever info you need to be rotated (banners, img's, html). Just put a hard return and <!-- SPLIT --> in between whatever you want rotated. Again super simple and useful. and make sure to put the filepath from your root into the rotatelist.txt. EDIT* on re-reading your post, maybe this wont work for you