ballhogjoni Posted June 22, 2007 Share Posted June 22, 2007 I am trying to develop a simple script that will rotate little ads. Not looking to rotate images but little bits of html files. Does anybody have any idea how to start and then is there a function that pulls random code from html files? Thank in advance Link to comment https://forums.phpfreaks.com/topic/56784-solved-ad-rotator/ Share on other sites More sharing options...
cooldude832 Posted June 22, 2007 Share Posted June 22, 2007 put all your html files as includes in a folder and label them in an array style and then explain how you want to rotate. You could do a mysql table that says how many times each ad has been viewed and auto loads the least viewed ad. or you could say select a random ad or you could say select random, but show least shown more often or show paid more more often Link to comment https://forums.phpfreaks.com/topic/56784-solved-ad-rotator/#findComment-280489 Share on other sites More sharing options...
chigley Posted June 22, 2007 Share Posted June 22, 2007 Simplest form: <?php $ads = array("<a href=\"http://www.google.co.uk\">Free search engine!</a>", "<a href=\"http://www.phpfreaks.com\">PHP help!</a>"); $rand = array_rand($ads); $advert = $ads[$rand]; echo $advert; ?> Link to comment https://forums.phpfreaks.com/topic/56784-solved-ad-rotator/#findComment-280495 Share on other sites More sharing options...
ballhogjoni Posted June 23, 2007 Author Share Posted June 23, 2007 Thank you Link to comment https://forums.phpfreaks.com/topic/56784-solved-ad-rotator/#findComment-280856 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.