PHP
  Home arrow PHP arrow Page 2 - Clicking Through: A phpBanner Primer
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Mobile Linux 
App Generation ROI 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PHP

Clicking Through: A phpBanner Primer
By: Melonfire
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 16
    2004-04-21

    Table of Contents:
  • Clicking Through: A phpBanner Primer
  • Start Me Up
  • Client Server
  • Of Pictures and Words
  • Hits And Misses
  • Hooking Up
  • Different Strokes
  • Clicking Through

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Clicking Through: A phpBanner Primer - Start Me Up


    (Page 2 of 8 )

    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


     

       

    PHP ARTICLES

    - Using Aliases and the Autoload Function with...
    - Authentication Scripts for a User Management...
    - Utilizing the Use Keyword for Namespaces in ...
    - Building a User Management Application
    - Working With Different Namespaces in PHP 5
    - User Management Explained: Overview
    - Using Namespaces in PHP 5
    - Building a Modular Exception Class in PHP 5
    - Database and Password Security for Web Appli...
    - Handling MySQL Data Set Failures in PHP 5
    - Building Site Registration for Web Applicati...
    - Intercepting Customized Exceptions in PHP 5
    - Sub Classing Exceptions in PHP 5
    - Building a Content Management System with Co...
    - Filters and Login Systems for Web Applicatio...

     
    Application Delivery: Everything You Wanted to Know, but Didn`t Know You Needed to Ask
    A comprehensive guide to examining the topics of Wide-area Data Services and app....

     
    Best Practices: Safe and Secure Hardware Asset Recovery
    Companies increasingly must meet EPA and local requirements for the disposal of ....

     
    Managing SSL Security in Multi-Server Environments
    Read this white paper to learn how to simplify management of your organization's....

     
    Open Source Security Myths
    Open Source Software (OSS) is computer software whose source code is available t....

     
    Power and Cooling Capacity Management for Data Centers
    This paper describes the principles for achieving power and cooling capacity man....

     




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
    Stay green...Green IT