Home arrow PHP arrow Page 2 - Clicking Through: A phpBanner Primer

Start Me Up - PHP

As your Web site gets more and more popular, you're going to need a capable banner management program to help you keep track of customers, banners and clicks. Take a look at phpBanner, which just might be what you're looking for!

TABLE OF CONTENTS:
  1. Clicking Through: A phpBanner Primer
  2. Start Me Up
  3. Client Server
  4. Of Pictures and Words
  5. Hits And Misses
  6. Hooking Up
  7. Different Strokes
  8. Clicking Through
By: Melonfire
Rating: starstarstarstarstar / 16
April 21, 2004

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

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.

mysql>

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:

phpBanner

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



 
 
>>> More PHP Articles          >>> More By Harish Kamath, (c) Melonfire
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

PHP ARTICLES

- Hackers Compromise PHP Sites to Launch Attac...
- Red Hat, Zend Form OpenShift PaaS Alliance
- PHP IDE News
- BCD, Zend Extend PHP Partnership
- PHP FAQ Highlight
- PHP Creator Didn't Set Out to Create a Langu...
- PHP Trends Revealed in Zend Study
- PHP: Best Methods for Running Scheduled Jobs
- PHP Array Functions: array_change_key_case
- PHP array_combine Function
- PHP array_chunk Function
- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: