Click here to Skip to main content
6,630,586 members and growing! (18,567 online)
Email Password   helpLost your password?
Web Development » ASP » General     Intermediate

Protecting pages with include files

By xicoloko

An article on how to easily password protect a site using include files
Windows, ASP, IIS, Dev
Posted:22 Aug 2000
Updated:14 Sep 2000
Views:99,680
Bookmarked:32 times
Announcements
Loading...
 
Search    
Advanced Search
Add to IE Search
printPrint   add Share
      Discuss Discuss   Broken Article?Report  
12 votes for this article.
Popularity: 3.96 Rating: 3.67 out of 5
2 votes, 50.0%
1

2

3

4
2 votes, 50.0%
5
  • Download source files - 3 Kb
  • Introduction

    In this article I will show you how to authenticate users so as to protect pages from being seen without permission. It uses a set of ASP files that will be included to each page that needs protection.

    In the example the authetication occurs with a couple of StrComp comparsions, but in real world it should be done using a table or a COM component.

    These are the necessary asp files with a explanation of its use:

    Login.asp This file ask for the userID and password
    LoginCheck.asp This file checks if the userID and password are OK. If so it redirects to the correct page, otherwise it redirects to the Access Denied page
    AcessDenied.asp This is the file with the Access Denied message, nothing more
    Pages.asp To be able to redirect to the right page after the login I gave each page a unique identifier. So this file has the list of pages and it's identifier. The URL is retrieved from the function GetURLFromNumber
    Protector.asp This file must be included in each page that needs protection. Before its inclusion an identifier called nURLID must be declared with the value of the identifier for this page (see Pages.asp).

    To see it working click here

    More information about include files can be found typing "#include" on the Index page of MSDN.

    License

    This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

    A list of licenses authors might use can be found here

    About the Author

    xicoloko


    Member
    XicoLoko is a brazilian developer based in Switzerland.

    Occupation: Architect
    Company: VisionOne AG
    Location: Switzerland Switzerland

    Other popular ASP articles:

    Article Top
    You must Sign In to use this message board.
    FAQ FAQ 
     
    Noise Tolerance  Layout  Per page   
     Msgs 1 to 18 of 18 (Total in Forum: 18) (Refresh)FirstPrevNext
    Generalwhat should i do with my retrieve data from database Pinsussvannak14:35 15 Jun '03  

    General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

    PermaLink | Privacy | Terms of Use
    Last Updated: 14 Sep 2000
    Editor: Chris Maunder
    Copyright 2000 by xicoloko
    Everything else Copyright © CodeProject, 1999-2009
    Web19 | Advertise on the Code Project