Logo         Community
The Company
Your Account
Contact Us
Clicking Through (A phpBanner Primer)
Track eyeballs and clicks with phpBanner

| Start Me Up |

phpBanner is a simple, no-nonsense banner management and tracking system for Web sites. It allows Web site administrators to manage advertisers and banners on the pages of a Web site, display them in a random or pre-defined arrangement, and track clicks on each. And it was simple to use - just read the single-page installation and instruction guide, and you're on your way!

The first thing is to make sure that you have everything you need for a successful installation of phpBanner. Typically, you'll need a PHP-compliant Web server (I'm using Apache), and a MySQL database server. Most Web hosting providers already offer these three components; however, in case yours doesn't, you can get Apache from http://www.apache.org/, PHP from http://www.php.net/ and MySQL from http://www.mysql.com/.

Once you've got all three packages configured and installed, download a copy of phpBanner from the official Web site at http://product.cybergl.co.id/dev/version.php?cmd=browse&product_id=3, and uncompress it to a location under your server root.

$ tar -xzvf phpBanner_0.0.2.tar.gz

Next, create a MySQL database to store all the application information. Drop to a command prompt, and start up the MySQL client.

$ mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 7311 to server version: 3.23.39

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.


Create a new database for the application (I've called mine "phpbanner").

mysql> CREATE DATABASE phpbanner;

With the database created, it's time to set up all the required tables. This isn't as hard as it sounds - the phpBanner distribution comes with a single SQL file, "phpBanner.sql", which contains all the SQL commands needed to set up the application's database tables. All you need to do is execute these commands via the MySQL's server's client program.

$ mysql -D phpbanner -u root -p < /usr/local/apache/htdocs/phpbanner/phpBanner.sql

Once the tables have been created, you need to set some configuration parameters so that the application knows where to find the database. Locate the "config.php" file in a folder named "require/" in the root directory of the application. Pop it open it in your favourite text editor and modify the contents so it looks like this:

#--------------------------------------- database configuration

$db_user= "phpbanner";
$db_pass= "phpbanner";
$db_name= "phpbanner";
$db_host= "localhost";

#--------------------------------------- tables configuration

$tbl_country = "country";
$tbl_client= "banner_client";
$tbl_banner = "banner_data";

#--------------------------------------- path configuration

$rootpath= "/usr/local/apache/htdocs/phpbanner/"; #change this to fit your environment
$imagepath = "$rootpath/images";
$uploadtempdir= "/tmp";
$clientpath = "$rootpath/client"; #you must set appropriate permission for write access to this directory
$reqpath= "$rootpath/require";
$incpath= "$rootpath/include";

#---------------------------------------url configuration

$rooturl  = "http://www.mysite.com/phpbanner";
$imageurl = "$rooturl/images";
$adminurl = "$rooturl/admin";
$clienturl= "$rooturl/client";

Most of these parameters are self-explanatory - the first set of parameters deals with the credentials required to access the database, the second set deals with the tables used by the application, the third set sets the location of the application's file paths and the fourth section contains the URL parameters required to access the application from a browser.

Remember to create a MySQL user and password matching the above credentials if it does not already exist, else the application will pop up lots of "Access Denied" messages.

Once you've made the necessary changes, save the file, and attempt to access the application URL through your browser. If phpBanner has been successfully installed and configured, you should see something like this:

Output image

Aaaaaand you're done! Flip the page to find out how you can begin using the application.

How to do Everything with PHP & MySQL
How to do Everything with PHP & MySQL, the best-selling book by Melonfire, explains how to take full advantage of PHP's built-in support for MySQL and link the results of database queries to Web pages. You'll get full details on PHP programming and MySQL database development, and then you'll learn to use these two cutting-edge technologies together. Easy-to-follow sample applications include a PHP online shopping cart, a MySQL order tracking system, and a PHP/MySQL news publishing system.

Read more, or grab your copy now!

previous page more like this  print this article  next page
In trog...
Logging With PHP
Building A Quick-And-Dirty PHP/MySQL Publishing System
Output Buffering With PHP
Date/Time Processing With PHP
Creating Web Calendars With The PEAR Calendar Class
In the hitg report...
Crime Scenes
Animal Attraction
Lord Of The Strings
In boombox...
Patience - George Michael
Think Tank - Blur
My Private Nation - Train
In colophon...
Hostage - Robert Crais
The Dead Heart - Douglas Kennedy
Right As Rain - George Pelecanos
In cut!...
American Chai
The Core
Find out how you can use this article on your own Web site!

Copyright © 1998-2018 Melonfire. All rights reserved
Terms and Conditions | Feedback