ASP
  Home arrow ASP arrow Page 4 - 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  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
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: 4 stars4 stars4 stars4 stars4 stars / 8
    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


    Make Revenue With Your Own Banner Management System - The ASP to add the banner


    (Page 4 of 11 )

    If you were paying attention over the last page or two, you would remember that our "Add a Banner" form posts our form data to addbanner2.asp. We'll create the addbanner2.asp page with the following code snippets (again, don't worry if you don't understand it, it will all make sense at the end of the article):

    <%@ Language="VBScript" %>

    <!-- METADATA Type="TypeLib" File="c:\program files\common files\system\ado\msado15.dll" -->


    If you've had even the smallest amount of exposure to ASP, you should be familiar with the <%@ Language=”VBScript” %> directive. This directive is optional, but should be included. It simply lets the ASP engine know that our page will contain VBScript code and not Jscript.

    The next tag may look unfamiliar. This is a special type of tag called a server-side include (or SSI for short). This tag tells the ASP engine to extract all constants and variables (knows as a type library) from the msado15.dll file (located in the c:\program files\common files\system\ado) directory on our web server. Msado15.dll (MSADO15 - Microsoft ActiveX Data Objects version 1.5) contains all of the constants that we will be using when we declare our database objects, such as cursor types, lock types, etc.

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

    set objRS = Server.CreateObject("ADODB.Recordset")

    set objUpload = Server.CreateObject("Persits.Upload.1")

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

    objUpload.OverwriteFiles = True

    objUpload.Save strBanner_Path


    The three "set ..." lines instantiate the database and upload objects that our script uses to handle our data. The first two set commands declare our database connection and recordset objects, which will be used to connect to and update our database respectively. The next line, set objUpload = Server.CreateObject("Persits.Upload.1") makes reference to our ActiveX object which will handle the uploading of our banner image. The ActiveX component is called Persits ASP Upload and can be downloaded from http://www.persits.com. Once you have downloaded the self-extracting executable, it's just a simple matter of running the install program and restarting your web server.

    Moving on, the strBanner_Path variable will hold the location of the directory in which we want our banners to reside once they have been uploaded. This should be a sub-directory of the directory holding your ASP scripts on the server (for example, if my scripts were located in c:\myscripts, I would use something like c:\myscripts\images for the images directory. Make sure the directory for your images exists before you run the script!). Change this variable if you need to. After this, we just set our Persits upload component to overwrite image files if they already exist, and set the save parameter to the strBanner_Path variable.

    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...







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
    Stay green...Green IT