Web Development

  Homes arrow Web Development arrow ch 3
 Webmaster Tools
Base64 Encoding 
Browser Settings 
CSS Coder 
CSS Navigation Menu 
Datetime Converter 
DHTML Tooltip 
Dig Utility 
DNS Utility 
Dropdown Menu 
Fetch Content 
Fetch Header 
Floating Layer 
htaccess Generator 
HTML Encoder 
HTML Entities 
IP Convert 
Meta Tags 
Password Encryption
Password Strength
Pattern Extractor 
Ping Utility 
Pop-Up Window 
Regex Extractor 
Regex Match 
Scrollbar Color 
Source Viewer 
Syntax Highlighting 
URL Encoding 
Web Safe Colors 
Forums Sitemap 
Weekly Newsletter
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Contact Us 
Site Map 
Privacy Policy 
  >>> SIGN UP!  
  Lost Password? 

ch 3
By: Developer Shed
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating:  stars stars stars stars stars / 0

    Table of Contents:

    Rate this Article: Poor Best 
      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




    Makeyour own banner managementsystem with ASP (continued)


    The ASP to add the banner

    Ifyou were paying attentionover the last page or two,you would remember thatour "Add a Banner" formposts our form data to addbanner2.asp.We'll create the addbanner2.asppage with the followingcode snippets (again, don'tworry if you don't understandit, it will all make senseat the end of the article):

    <%@ Language="VBScript" %>
    <!-- METADATA Type="TypeLib"File="c:\program files\commonfiles\system\ado\msado15.dll"-->

    If you've had even the smallestamount of exposure to ASP,you should be familiar withthe <%@ Language=”VBScript”%> directive. This directiveis optional, but shouldbe included. It simply letsthe ASP engine know thatour page will contain VBScriptcode and not Jscript.

    The next tag may look unfamiliar.This is a special type oftag called a server-sideinclude (or SSI for short).This tag tells the ASP engineto extract all constantsand variables (knows asa type library) from themsado15.dll file (locatedin the c:\program files\commonfiles\system\ado) directoryon our web server. Msado15.dll(MSADO15 - Microsoft ActiveXData Objects version 1.5)contains all of the constantsthat we will be using whenwe declare our databaseobjects, such as cursortypes, 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 ..." linesinstantiate the databaseand upload objects thatour script uses to handleour data. The first twoset commands declare ourdatabase connection andrecordset objects, whichwill be used to connectto and update our databaserespectively. The next line,set objUpload = Server.CreateObject("Persits.Upload.1")makes reference to our ActiveXobject which will handlethe uploading of our bannerimage. The ActiveX componentis called Persits ASP Uploadand can be downloaded fromhttp://www.persits.com/.Once you have downloadedthe self-extracting executable,it's just a simple matterof running the install programand restarting your webserver.

    Moving on, the strBanner_Pathvariable will hold the locationof the directory in whichwe want our banners to resideonce they have been uploaded.This should be a sub-directoryof the directory holdingyour ASP scripts on theserver (for example, ifmy scripts were locatedin c:\myscripts, I woulduse something like c:\myscripts\imagesfor the images directory.Make sure the directoryfor your images exists beforeyou run the script!). Changethis variable if you needto. After this, we justset our Persits upload componentto overwrite image filesif they already exist, andset the save parameter tothe strBanner_Path variable.

    Top quality daily ASP, PHPand .NET articles, tutorials,news, reviews, interviewsAND FREE EBOOKS! devArticlesis the ultimate online resourcefor the serious web developer.Visit



    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

    More Web Development Articles
    More By Developer Shed



    - On Page SEO for New Domains
    - Improve Your Site`s Speed
    - Safari Books Online Review
    - Creating an Estore From the Ground Up
    - Most Common SEO Mistakes Developers Make
    - Making the Most of Your Titles and Meta Desc...
    - Five Ways Using Flash Can Damage Your Site
    - A Web Designer`s Guide to Colors
    - Use Webstarts to Create a Free Site
    - More Than Just Looks. How Your Web Design C...
    - How to Design Content Pages
    - Mint Review
    - Make Your WordPress Website Look Professional
    - How to Create a Mobile Web Site
    - Meta Tags: Still Useful?

    Developer Shed Affiliates


    © 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap