ASP
  Home arrow ASP arrow Page 7 - 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 
Moblin 
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
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Make Revenue With Your Own Banner Management System - Deleting a banner


    (Page 7 of 11 )

    No doubt, you'll be curious as to how to go about deleting a banner from your rotation, right? To delete a banner, we will create a new page called delbanner.asp. Once you have created the page, you can click on the [ Delete ] link from the "Current Banners in Rotation" page to remove a banner from the list. Create a new page called delbanner.asp and add the following code to it:

    <%@ Language="VBScript" %>

    <%

    dim objConn

    set objConn = Server.CreateObject("ADODB.Connection")

    objConn.Open "Provider=SQLOLEDB; Data Source=localhost; Initial Catalog=myAdStuff; UId=sa; Pwd="

    objConn.Execute "delete from banners where bannerId=" & Request.QueryString("bannerId")



    Response.Redirect("banners.asp")

    %>


    I told you it was simple to delete a banner! Lets look at the code above in more detail:

    objConn.Execute "delete from banners where bannerId=" & Request.QueryString("bannerId")

    objConn.Close

    set objConn = nothing



    Response.Redirect("banners.asp")

    %>


    Once we have made a connection to the database, we will use our connection object (Yes, you can execute an SQL query using a

    connection object as well!) to parse the SQL query to delete a banner. If you jump back to the banners.asp page, you'll notice that when you run your mouse over the [Delete] link of a banner, you'll see something like http://localhost/delbanner.asp?bannerId=23 in the status bar of your browser. It's the bannerId=23 part of the URL that is used as the id of the banner to delete in our SQL query. In our example above, Request.QueryString("bannerId") would evaluate to 23.

    Finally, when the command has executed, we close and free our database connection and re-direct the browser back to the list of banners.

    That's all for part one of my article on creating a banner management system. In part two, we will display the banners on our website and track impressions through our management system.

    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 1 hosted by Hostway