Review - phpAdsNew Banner Management System

One of the great things about open source repositories such as SourceForge is that they provide access to a huge amount of quality software produced by talented developers from around the world.

SourceForge is a dream come true for Web developers looking for quality free Web apps and scripts for their open source-driven Websites. One of the most popular apps available on SourceForge is called phpAdsNew. phpAdsNew is a PHP/MySQL driven Web app that allows anyone to integrate ads into their Website.

phpAdsNew is one of the most popular open source ad projects on the Internet. I use it on my own site, and I’d honestly have to say that it’s the best ad management system I’ve ever used. In this article I’ll give you a guided tour of phpAdsNew. If you run your own site and attract a couple of thousand visitors each day, then you might want to consider using phpAdsNew to generate some revenue for all your hard work.

What is phpAdsNew?

In my opinion, it’s the best ad management system on the Internet. I’m a little biased however, because I love open source software. So here’s the "official" description, as seen on the SourceForge page:

"phpAdsNew is a banner management and tracking system written in PHP. Currently it can manage multiple banners (any size) per advertiser, view daily, overall and summary statistics and send statistics to advertisers via email."

I think that description pretty much says it all. At the time of writing this article, phpAdsNew was :

  • in mature development stage,
  • OS independent, and
  • had a 99.8656% activity percentile on SourceForge

which means that it’s one of SourceForge’s most popular downloads… and with good reason! phpAdsNew is maintained by a team of 9 developers from around the world.

The current release of phpAdsNew is version 2 beta 6.1, which you can download here. Grab either the tar (262k) or zip (378k) version, and extract it into a folder on your Web server. By default, the folder will be called something like phpAdsNew_2.61, but rename it to phpAdsNew.

Next off we need to configure the details of our database. Open the file in your phpAdsNew directory and look for the following lines at the top of the file:

/*********************************************************/   /* Database configuration */   /*********************************************************/  

// MySQL hostname   $phpAds_hostname = "localhost";  

// MySQL username   $phpAds_mysqluser = "mysqlusername";  

// MySQL password   $phpAds_mysqlpassword = "mysqlpassword";  

// The database phpAdsNew lives in   $phpAds_db = "phpads"; 

You must change the variables shown above to match the details of the Web server where you have MySQL installed, in order for phpAdsNew to work. To make the $phpAds_db variable function, a database with that name must exist on your MySQL server, so fire up the MySQL console application and enter the following:

create database phpads;   exit; 

Next, find the administrator configuration section in and change the value of $phpAds_admin, which is the username we will use shortly to login to phpAdsNew. You should also change $phpAds_admin_pw to a suitable password.

Lastly, modify the variables under the phpAdsNew configuration section. Save and visit http://yourserver/phpadsnew in your Web browser. Obviously, you need to replace "yourserver" in the address above with either the name or IP address of the server onto which you installed phpAdsNew.

Now that we’ve created our phpAdsNew database, we need to import the table structures for it, which can be found in all.sql in phpAdsNew’s main directory. Jump onto your MySQL server and import the contents of all.sql, like this:

mysql -uadmin -ppassword phpads < c:phpadsnewall.sql 

I’ve installed phpAdsNew on my Windows 2000 server running Apache, so obviously if you’re running Linux, then you’ll need to change the path to all.sql. MySQL should respond with a blank line. If you get any errors, double check your login credentials as well as the name of your database and where you’re telling MySQL to find all.sql.

Now, load phpAdsNew in your browser. I installed it locally on my Web server, so I loaded up http://localhost/phpadsnew. Here’s what it looked like:

Review - phpAdsNew Banner Management System

Enter the values for the user and password that you specified in the file and click on the login button. The phpAdsNew stats screen will load:

Review - phpAdsNew Banner Management System

Using phpAdsNew

phpAdsNew has zones, clients, and banners. First off, we want to add a client, so click on the administration tab and then the ‘add new client’ link. Complete the details of the client when the page loads. Before you click on the save changes button, you should think carefully about whether or not you would like to allow this client to login to your phpAdsNew system and modify his or her campaign.

If you’d like to give your clients the flexibility to change their banner whenever they like, then you should enter a username and password for them and select the appropriate checkboxes for them, which are shown below:

Review - phpAdsNew Banner Management System

When you’re done, click on the save changes button. phpAdsNew will now let you create a new campaign for this client. The great thing about phpAdsNew is that you can either set how many impressions this clients ad will have, you can set both activation and expiry dates for the ad, or you can just let the ad run for as long as you like.

The weight field is the frequency at which the ad will be shown. The default is 1, but you can set it to a higher value if you’d like the ad to appear more frequently than others if it’s in a rotation.

Set the options for this client’s campaign, and click save changes. phpAdsNew will create the new campaign and redirect you back to the zones page. To create a banner for this client, click on the create link under their campaign:

Review - phpAdsNew Banner Management System

Once the add new banner page loads, there are four possible types of banners that we can create:

Banner stored in SQL

This option allows you to upload an image directly into the phpAdsNew MySQL database. It’s stored as a blob, and you don’t have to worry about storing image files on your server.

Banner stored on the Web server

If you’d like to store your banner images on your Web server, then choose this option.

Banner references to through URL

This option allows you to reference a banner that’s available online (i.e. http://…). If you’re running banners as part of an ad network, then this is the option that you’re after.

HTML banner

HTML banners are ideal for rich media ads such as flash movies, or even plain text ads, which generally have a great click-thru rate (CTR).

For this article, we’ll create a banner stored in SQL, so select that option and choose/create a banner from your hard drive. I have created a simple 468×60 banner. Once you click on the submit ad button, phpAdsNew will show you how your banner will look. Here’s what mine looked like:

Review - phpAdsNew Banner Management System

Now that our banner’s been created, it’s time to tell phpAdsNew to generate the banner code for it, which we can include in our Web pages to display the banner. Click on the administration tab and then the generate banner code link, just under the tab. Once again, there are several options to choose from. The way the banner is invocated can be one of five possible options:

  • Remote Invocation: An image tag will be generated that points to the location of phpAdsNew’s adview.php script, passing in the ID of the client whose banner we want to display.
  • Remote Invocation with JavaScript: Generates a <script> tag which references adjs.php, which uses JavaScript’s document.write function to display the banner.
  • Remote Invocation for iFrames: Generates an <iframe> tag that references adframe.php. Adframe.php returns the image so it’s displayed inside of the iFrame.
  • Combined Remote Invocation: Uses a combination of an <iframe> tag and <script> tag to generate a banner called from JavaScript based inside of an iFrame.
  • Local Mode: PHP code that includes and calls that scripts view function. This is the default mode, however if you’re using MySQL in other areas of your site to display data, then I would recommend staying away from this option.

Once you’ve chosen your banner display options, you’ll need to select the banner to be displayed from the ClientID drop down list. If you’d like the URL that the banner links to open in a new window, enter something like _blank in the target field. In this example I’m using remote invocation, so here’s the code that phpAdsNew generated when I clicked on the generate button:

<a href='http://localhost/phpAdsNew/adclick.php' target='_blank'><img     src='http://localhost/phpAdsNew/adview.php?clientID=2&target=_blank'     border='0'></a> 

Obviously at this point, it’s simply a matter of copying and pasting the generate code into your Web page, and then saving it.

At this point we haven’t really explored the capabilities of phpAdsNew, so let’s now take a look at its powerful reporting and banner rotation features.


One of the things I really like about phpAdsNew is its powerful statistic and graphing capabilities. By simply clicking on the statistics tab in phpAdsNew, you’re presented with detailed stats for each campaign you currently run:

Review - phpAdsNew Banner Management System

For each campaign, phpAdsNew shows its ID, number of ad views, number of ad clicks, and its click through rate (CTR). Below the details of each campaign is a set of overall stats for all banners, including number of banners shown today, this week and this month, as well as number of clicks and CTR for each period.

On the statistics page, there’s also two links to history and weekly statistics. If you click on the history link, then you’ll be shown a tabulated list of days and the number of ad views, clicks, and CTR for those days. The weekly statistics link shows many of the same things, but in a weekly format.

Sometimes it’s handy to have our banner stats available offline, and, as you’ll see if you click on the reports tab, phpAdsNew supports this functionality. By simply choosing the campaign you’re after, phpAdsNew will generate a file called campaignhistory.csv, which is a set of values separated by commas. By choosing to open this CSV file, my Windows 2000 server launched Excel, and it looked like this:

Review - phpAdsNew Banner Management System

Of course I’ve only added one campaign to demonstrate how phpAdsNew works, but if you had dozens of campaigns, then Excel’s chart wizard would allow you to create professional looking charts from your phpAdsNew campaign data, which can be used in your media kit to help persuade potential advertisers to advertise on your site.

Banner Rotations

One of the best ways to generate more revenue for your site is to set up banner rotations. As compared to normal banners, a rotation contains several (usually 5-20) banners in one ad space; a randomly selected ad from the set is displayed for each page view. Each advertiser gets a shared number of impressions, and rotations are great when you’re trying to advertise similar products/services to a niche audience.

To set up a banner rotation with phpAdsNew, simply create at least two banners and click on the administration -> generate bannercode link. The what field allows you to specify the criteria for the rotation. For example, if you wanted to set up a rotation with all your 468×60 banners, then you would enter 468×60 into the text box.

You can also display banners in rotation based on their name. If you created two banners that both have the word ‘test’ in their name, for example, then you can specify ‘test’ as the value of the what field. All banners with the word ‘test’ in their name would then be displayed in the rotation.

The what field can also accept some rather complex statements, allowing you to specify exactly which banners should be included in a rotation. If you want to match a banner by its ID, you can use the following statement:


On some occasions, it’s also handy to display only HTML banners, or only SQL-based banners, etc. We can do this by specifying the format statement in the what field, like this:


As mentioned earlier, you can specify the width of the banners you’d like in the rotation with width x height, just like this:


You can also specify just the width of the banner, like this:


There are dozens of other advanced values for the what field, including matching based on logical operators, the global keyword and more. If you’re interested in these other advanced values, then consult the phpAdsNew documentation, chapter 3.2.


In this article we’ve seen how to set up and use phpAdsNew, which is a great, free, open-source ad management system. If you run your own Website then you should consider using phpAdsNew to add some advertising to your site as a way to make some extra revenue for your hard work.

I think that the reason why phpAdsNew is so popular is because it’s always being updated and debugged, much like all of the other Web apps on SourceForge. I myself will use phpAdsNew both now and into the future, as I personally believe that there’s no other ad system like it.


Category: programming Time: 2002-05-20 Views: 2

Related post

  • Review - Tinderbox Content Management System 2004-02-27

    In October, 2003, I suggested that Web content should be written for the Web rather than tied down by the assumptions of paper and pencil. At the time, I believed that the wiki was the most powerful tool available for practical hypertext writing. The

  • Create your own Banner Management Application 2001-10-12

    If you're like me, then you probably run one or more small sites that either provide information to your visitors, or sell a range of products and services targeted at a specific audience. You have people that you trust managing and updating content,

  • Good Open Source Content Management System For Teacher and Students (Middle School)? 2009-06-25

    Is there a good content management system that could run on Linux that could be used with middle school students? The idea is that each kid would create his/her page and then the pages would all be reviewed by the teacher (for spelling, grammar, etc)

  • Strengths of various open-source PHP Content Management Systems? 2010-08-07

    Possible Duplicate: Which Content Management System (CMS) should I use? What are the strengths / weaknesses of the various PHP-based open source CMSes? --------------Solutions------------- Wordpress I am a big fan of wordpress for simple small sites.

  • What test management system should I use? 2013-07-17

    There must be many questions like this on the site but I have some unique requirements that affect my choice of test management / QA process management system. This is for managing the test cases and recording results, not for performing the actual t

  • Is there a document management system that keeps track of child/forked documents? 2015-01-06

    We have a core document, say, a series of standards, that, based on that, we create solution guides, promotional materials, or other supporting documents. The idea is that every time you change that core document, you have a way to trigger or flag al

  • Messed up Elevator Management System 2015-09-27

    In light of our current community-challenge I decided to build an Elevator Management System. Initially I intended to program the EMS like a real-time operating system and the elevators as finite-state machine threads with each their own handler. It

  • Package management system 2015-11-20

    A short time ago, I discovered the LinuxFromScratch project. After getting a system up and working (after much struggling), I realized that if I wanted to continue using LFS, some sort of package management would be quite nice. Of course I could have

  • A Look at Content Management Systems in Rails 2016-07-14

    Ruby has an active ecosystem built around it, one that is concerned about the tools used by everyone in it. This is fueled by the love members of the community have for their favorite language. Because Ruby and Rails have such great communities, many

  • Build an XML-Based Content Management System with PHP 2003-07-09

    Like most developers, you've probably heard a great deal about XML and content management systems. It's likely, however, that you've only been exposed to theoretical discussions that haven't been grounded in practical knowledge. This step-by-step tut

  • Favorite Document Management Systems 2009-08-06

    We are a small software consulting firm with 10 programmers. We have many corporate contracts and paperwork that we currently organized in a big file share with hierarchical directories. This is causing some headaches (though not a ton) around the la

  • Which is an easy to use Document Management System given my requirements 2009-08-24

    Original question on SO. I looked up a lot of threads on a good document management system on SO. So, given all that knowledge, here is my question: What is a very intuitive, open source (preferably with no commercial upgrade) document management sys

  • Client wants a Client Management System 2009-10-30

    I have a client of mine that wants a Client Management System. They want something web based, priced well (free would be amazing) where they can keep track of their clients information, when they've contacted that client and what that client has purc

  • What are some options for a small organization's contact management system? 2009-12-29

    I would like to implement some sort of contact database management system within a small company. At this point I have roughly 200 contacts but I see a prospecting database could grow over 500 but probably not more than 1000. I would like contacts to

  • SSH keys management system 2010-01-02

    I'm looking to switch from password based (which I starting to become overwhelmed with) to SSH keys based system. I'd like to know if there any SSH keys management system or server solution, which would allow me to distribute and revoke keys over mac

  • How should I proceed with establishing a Remote Infrastructure management system for my [small] company? 2010-02-05

    My company is having a small IT infrastructure. Details are: 125 computers One mail server One NAS and One database server We want to establish a remote infrastructure management system, where in our team located in another city can manage the infras

  • Is Evernote a good task management system? 2010-03-09

    Someone recently recommended Evernote and I wanted to see if anyone has an opinion on this software as their main task management system. It seems like it might be overkill --------------Solutions------------- Having been an Evernote user for the las

  • Which network management system (NMS) to choose? 2010-04-22

    I need to integrate NMS in large enterprise system for data collection purposes. Primary requirements: collection by SNMP great scalability (up to 1,000 devices with 1,000 interfaces each) failover data storage in Oracle DBMS integration API (configu

  • Recommendations for a Document Management system for Windows 2010-05-25

    Possible Duplicate: Which is an easy to use Document Management System given my requirements. What's the best way to manage a large amount of documents (word,ppt,pdf...) when Windows Explorer is not sufficient? Preferably desktop based solution -----

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development


Front-end development


development tools

Open Platform

Javascript development

.NET development

cloud computing


Copyright (C), All Rights Reserved.

processed in 0.791 (s). 13 q(s)