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