Domain Discussion Board

Go Back   Domain Discussion Board > General > Tutorials

 
Reply
 
LinkBack Thread Tools Display Modes
PHP Banner Rotator
Old
  (#1 (permalink))
pSyChO mOnkee
Senior Member
pSyChO mOnkee is on a distinguished road
 
pSyChO mOnkee's Avatar
 
Status: Offline
Posts: 102
Points: 165.3
Bank: 1,162.7
Total Points: 1,328.0
Donate
Join Date: Sep 2007
Rep Power: 0
PHP Banner Rotator - 09-09-2007, 04:53 PM

PHP Ad Management Simple banner rotator Tutorial

To display banner ads on your website you can just sign up with Google’s AdSense program or one of the many other advertising programs out there. But if you want to show your own banners or those of your website members and sponsors you should have your own banner script.

For now we will take care of the displaying of the banners. Tracking the number of clicks will be handled in a different tutorial. So lets have a look at what we want this script to do exactly.

If I have several banners to display I would want them all to be displayed an equal number of times. We can force this by tracking how many times each banner has been displayed and select the banner with the least number of views to show. Another way is to just select one of the banners randomly. Statistics and probability tell us that randomly selecting one of the banners each time, will over time give each banner a fairly equal amount of views. For this script we will use the random function to select which banner to display.

To track how many times each banner has been displayed we need to add a counter to each banner. The counter will have to be updated each time we display the banner.

In addition to the banner picture, the alt tag and title tag should be filled. Lets store all the banner information (target URL, picture URL, alt and title tag, banner views) in a MySQL database.

Let’s list the steps of our banner script:
1. Count how many banners we have stored in our database table
2. Create a random number between 1 and the number of banners found in step 1
3. Retrieve the record number equal to the random number that we generated
4. Update ‘times viewed’ counter on that record
5. With the retrieved record data, create a link with an image and required tags.

Continued at the link above...enjoy


--Your Link Here (PM Me)--
   
Reply With Quote
Re: PHP Banner Rotator
Old
  (#2 (permalink))
jeremyshaw
 
Status:
Posts: n/a
Points: 0
Bank: 0
Total Points: 0
Donate
Re: PHP Banner Rotator - 09-09-2007, 08:21 PM

I thought that AdSense's TOS said no ad rotators.

https://www.google.com/adsense/suppo...n&answer=48182

Last edited by jeremyshaw : 09-09-2007 at 08:24 PM.
   
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Points Per Thread View: 1.0
Points Per Thread: 15.0
Points Per Reply: 5.0


Similar Threads
Thread Thread Starter Forum Replies Last Post
FREE CGI Hosting blue-sky Wonderful Websites 21 04-27-2008 07:12 AM
Free php web hosting...Part 1 blue-sky Hosting Providers 24 12-22-2007 02:28 AM
Free php web hosting part 2 (I think this is a final php hosting i given) blue-sky Wonderful Websites 9 04-26-2007 03:03 PM
Learn php (setp by step) Segman Scripts 2 02-28-2007 02:16 AM


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 ©2007, Crawlability, Inc.