Jump to content

[SOLVED] Ad rotator?


ballhogjoni

Recommended Posts

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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.