Home arrow ASP arrow Page 7 - Make Revenue With Your Own Banner Management System
ASP

Make Revenue With Your Own Banner Management System


In this article Mitchell shows us how to develop a simple ad campaign and management system using ASP and an SQL Server database.

Author Info:
By: Mitchell Harper
Rating: 5 stars5 stars5 stars5 stars5 stars / 33
November 01, 2001
TABLE OF CONTENTS:
  1. · Make Revenue With Your Own Banner Management System
  2. · Adding the banners
  3. · Saving the banners
  4. · The ASP to add the banner
  5. · The ASP to add the banner (contd)
  6. · Listing the banners
  7. · Deleting a banner
  8. · Displaying and tracking banners, impressions and click-thrus
  9. · The code in detail
  10. · Handling the banner clicks
  11. · Conclusion

print this article
SEARCH DEVARTICLES

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.


blog comments powered by Disqus
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...

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials