SunQuest
 
       ASP
  Home arrow ASP arrow Page 6 - Make Revenue With Your Own Banner Manageme...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Dedicated Servers  
Actuate Whitepapers 
VeriSign Whitepapers 
IBM® developerWorks 
Sun Developer Network 
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? 
ASP

Make Revenue With Your Own Banner Management System
By: Mitchell Harper
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 7
    2001-11-01

    Table of Contents:
  • Make Revenue With Your Own Banner Management System
  • Adding the banners
  • Saving the banners
  • The ASP to add the banner
  • The ASP to add the banner (contd)
  • Listing the banners
  • Deleting a banner
  • Displaying and tracking banners, impressions and click-thrus
  • The code in detail
  • Handling the banner clicks
  • Conclusion

  • 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
     
    Iron Speed
     
    ADVERTISEMENT

    At the virtual BlackBerry Technical Seminar 2008, you can ask your development questions directly of Research In Motion® (RIM) experts, and take advantage of learning opportunities designed uniquely for BlackBerry solution developers. Register Today!

    Make Revenue With Your Own Banner Management System - Listing the banners


    (Page 6 of 11 )

    Believe it or not, we've overcome the hardest part of our coding! For this step, we want to create a list of banners in our rotation, and we also want to be able to delete a banner if we need to. Lets start by creating a simple ASP script that will show our banners in a table on a HTML page. The code for banner.asp (described below) is part of the support material for this article and can be downloaded from the last page.

    dim objComm

    ...

    set objComm = Server.CreateObject("ADODB.Command")

    ...

    objComm.ActiveConnection = objConn

    objComm.CommandType = adCmdText


    In this part of our ASP script, we are introducing a new database object called a command object. A command object is used to parse commands to SQL server. These commands can either be stored procedures, text commands, commands held in files, etc. For our banner system, we're only interested in passing plain old text queries to SQL server. To do this, we set the CommandType parameter of our command object (objComm) to adCmdText, meaning this: "Any query that is passed to SQL server should be interpreted as plain text".

    Through the command object, we get a list of all of our banners using a simple select query. The results for the query are stored in our recordset object (objRS). This is shown below:

    objComm.CommandText = "select * from banners order by bannerName asc"

    set objRS = objComm.Execute


    Now that we have a list of rows in our recordset object, we can loop through each row, and display the data in our HTML table. We will display a link to delete the banner (explained later), the banners name, impression and click-thru numbers, and image. Remember to change the strBanner_Path variable to the directory where you saved your banners.

    strBanner_Path = "c:\inetpub\wwwroot\banners"

    ...

    while not objRS.EOF

    %>

    ...

    <%

    objRS.MoveNext

    wend

    %>


    If all goes well, you'll be presented with a list of banners in your database, just like the one shown below:

    Table listing banners retrieved from the database

    More ASP Articles
    More By Mitchell Harper


     

    ASP ARTICLES

    - Central Scoreboard with Flash and ASP
    - Calorie Counter Using WAP and ASP
    - Creating PGP-Encrypted E-Mails Using ASP
    - Be My Guest in ASP
    - Session Replacement in ASP
    - Securing ASP Data Access Credentials Using t...
    - The Not So Ordinary Address Book
    - Adding and Displaying Data Easily via ASP an...
    - Sending Email From a Form in ASP
    - Adding Member Services in ASP
    - Removing Unconfirmed Members
    - Trapping HTTP 500.100 - Internal Server Error
    - So Many Rows, So Little Time! - Case Study
    - XDO: An XML Engine Class for Classic ASP
    - Credit Card Fraud Prevention Using ASP and C...


    Iron Speed





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway