Home | Design | Training | Store | Customers | About

The following is a simple demonstration of an ASP login model.

Try it with ...
Username=admin
Password=password

Steps Description File/Code
1 User attempts to login login.asp
<%@ LANGUAGE = "VBSCRIPT" %>
<html>
<head>
<title>Login</title>
</head>
<body>
<form method="post" action="login_check.asp">
Username: <input type="text" name="user" size="20"><br>
Password: <input type="password" name="pass" size="20"><br>
<input type="submit" value="Submit"></form>
</body>
</html>
 
2 User ID and Password checked
- if invalid go to step 3
- if valid go to step 4
login_check.asp
<%@ LANGUAGE = "VBSCRIPT" %>
<%
User = Request.Form("user")
Pass = Request.Form("pass")
If (User = "admin") and (Pass = "password") Then
Response.Redirect("login_valid.asp")
Else
Response.Redirect("login_invalid.asp")
End If
%>
 
3 Display Error message
- go to step1
login_invalid.asp
<%@ LANGUAGE = "VBSCRIPT" %>
<html>
<head>
<title>Invalid</title>
</head>
<body>
<p>Invalid User ID or Password!</p>
<p><a href="login.asp">Try again</a></p>
</body>
</html>
 
4 Authentication successful login_valid.asp
<%@ LANGUAGE = "VBSCRIPT" %>
<html>
<head>
<title>Valid</title>
</head>
<body>
<p>Successful Logon</p>
<!-- this would be the destination page -->
<p><a href="../../index.html">Home</a></p>
</body>
</html>
 

Note:

  • This Login Script must be run on a Web Server supporting Internet Information Server (IIS).
  • This Script is very basic and can be bypassed if the used understands HTML Forms
    (if using FrontPage, placing the login_check.asp file into your _private folder will provide additional security to this script)

 

  Home | Design | Training | Store | Customers | About | Resources | Search | Contact