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  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
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? 
Google.com  
PHP

Clicking Through: A phpBanner Primer
By: Melonfire
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 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:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log 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

    - Merging a File Split for FTP Upload using PHP
    - Getting Data from Yahoo Site Explorer Inboun...
    - Method Chaining: Adding More Selecting Metho...
    - How to Split a File During an FTP Upload Usi...
    - Expanding a Custom CodeIgniter Library with ...
    - Using the Yahoo Site Explorer Inbound Links ...
    - Building a CodeIgniter Custom Library with M...
    - Building an E-mini Trading System Using PHP ...
    - Completing the MySQL Class with Method Chain...
    - Building Dynamic Queries with Chainable Meth...
    - PHP Encryption and Decryption Methods
    - Building a MySQL Abstraction Class with Meth...
    - Completing a Sample String Processor with Me...
    - Mastering WHILE Loops for PHP and MySQL
    - Method Chaining: Adding More Methods to the ...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek