ASP 101 - Active Server Pages 101 - Web01
The Place ASP Developers Go!

Please visit our partners

Windows Technology Windows Technology
15 Seconds
4GuysFromRolla.com
ASP 101
ASP Wire
VB Forums
VB Wire
WinDrivers.com
internet.commerce internet.commerce
Partners & Affiliates














ASP 101 is an
internet.com site
ASP 101 is an internet.com site
IT
Developer
Internet News
Small Business
Personal Technology
International

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

ASP 101 News Flash ASP 101 News Flash


 Top ASP 101 Stories Top ASP 101 Stories
What is Adovbs.inc and Why Do I Need It?
An Overview of ASP.NET
Connections, Commands, And Procedures

QUICK TIP:
Find The Properties of an ADO Connection
Show All Tips >>


Multi-User Login With Database-Based Authentication

by Rahul Mahajan

Multiple User Accounts with User Authentication with the help of Database connection.

I would like to share the ASP code prepared by me - Multi User Login & Authentication. It's a Multi-User Login code with new user registration, login, password retreving, account information, admin account etc. The code is written in ASP and VBscript.

The files included are as follows:

File Type File Name Details
Registration File registration.asp The registration page for new user.
Login File login.asp The login page of website.
Forgot Password File forget.asp The password retrieving page of website.
Authentication File logincheck.asp File used for User/Login Authentication.
Protected Area File protected.asp The protected file/area of website.
Login Check File validate.asp The file use at the time of login.
Unauthorized Area File unauthorized.asp File will be shown on unauthorized login.
Logout File logout.asp The logout page of website.
Contact Form contactus.html Feedback/Contact Form of website.
For Administrator
View User Information File edituser.asp Admin can view user's account information.
Delete User File deleteuser.asp Admin can delete user's account information.

Database File (i.e. users.mdb) is password protected named - password

Other Added VBScripts & ASP Files All these files are in a folder named Example.
Database (.mdb) File
Global.asa File

Code Briefing:

  • Now let me tell you how it works. Firstly, when the user want to visit the PROTECTED AREA of your site, he/she have to register his/her name before login - registration.asp
  • After completing the Registration process, new user can login - login.asp
  • User enters the Username and Password - if the Username and Password is correct, then the protected page will be open - protected.asp
  • If the Username or Password are incorrect - an error message will be displayed and user will be redirected to login page again.
  • To logout the protected area of the file simply click - logout.asp
  • After logout, if the the user/member has to login again then he/she have to login again.

Simple!

About Authentication File (logincheck.asp):

Please note that this file is very important if you have links in PROTECTED AREA of your website and you want them not to be open without login, then this code is for you.

Example:

Login Page --> After entering correct Username & Password opens --> Protected Page

Protected Page

|

Link1 - Link2 - Link3 - Link4 - Link5

Suppose the user visits the PROTECTED AREA of the website on Day1 and found that there are some Links which are written in protected page (i.e. protected.asp, in this case) and the user visits one of the given link. If the user notes the URL of that particular page then the user can easily visit that page without login. To prevent this, Authentication File is used. Therefore user has to login each time user visit the site.

There are two methods to perform:

  1. By including Authentication File on the top of every page linked to PROTECTED AREA before <html> tag.

    <!--#include file="logincheck.asp"-->

  2. By writing the content of the logincheck.asp on the top of every page PROTECTED AREA before <html> tag.

Get the Code

Please copy all files to a web server running IIS 5.0 or IIS 6.0 and try the code out for yourself.

Important: If you want to test the code on a free server, then you must upload the files on a free server which supports ASP and MS-Access.

If you still face any problem then please mail me on above E-Mail address.

Happy Programming!

You can download discussed above from here: Multi-User_Login.zip (100 KB)


Home |  News |  Samples |  Articles |  Lessons |  Resources |  Forum |  Links |  Search |  Feedback



JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
Microsoft Article: HyperV-The Killer Feature in WinServer ‘08
Avaya Article: How to Feed Data into the Avaya Event Processor
Microsoft Article: Install What You Need with Win Server ‘08
HP eBook: Putting the Green into IT
Whitepaper: HP Integrated Citrix XenServer for HP ProLiant Servers
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 1
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 2--The Future of Concurrency
Avaya Article: Setting Up a SIP A/S Development Environment
IBM Article: How Cool Is Your Data Center?
Microsoft Article: Managing Virtual Machines with Microsoft System Center
HP eBook: Storage Networking , Part 1
Microsoft Article: Solving Data Center Complexity with Microsoft System Center Configuration Manager 2007
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Intel Video: Are Multi-core Processors Here to Stay?
On-Demand Webcast: Five Virtualization Trends to Watch
HP Video: Page Cost Calculator
Intel Video: APIs for Parallel Programming
HP Webcast: Storage Is Changing Fast - Be Ready or Be Left Behind
Microsoft Silverlight Video: Creating Fading Controls with Expression Design and Expression Blend 2
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Sun Download: Solaris 8 Migration Assistant
Sybase Download: SQL Anywhere Developer Edition
Red Gate Download: SQL Backup Pro and free DBA Best Practices eBook
Red Gate Download: SQL Compare Pro 6
Iron Speed Designer Application Generator
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
How-to-Article: Preparing for Hyper-Threading Technology and Dual Core Technology
eTouch PDF: Conquering the Tyranny of E-Mail and Word Processors
IBM Article: Collaborating in the High-Performance Workplace
HP Demo: StorageWorks EVA4400
Intel Featured Algorhythm: Intel Threading Building Blocks--The Pipeline Class
Microsoft How-to Article: Get Going with Silverlight and Windows Live
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES