-
Step 1
Create the HTML page first by opening Notepad or another text editor. Type the following code exactly as it appears on separate lines. When done, save it with the name Login_Page.html (deleting the automatic txt extension).
<html>
<head>
<body>
<form id="LOGIN" name="LOGIN" method="post" action="ASP_LOGIN.asp">
<table align="left" cellpadding="5" cellspacing="0" border="2">
<tr>
<td>UserID</td>
<td><input type="text" name="UserID" /></td>
</tr>
<tr>
<td>Password</td>
<td><input type="password" name="Password" /></td>
</tr>
<tr>
<td colspan="2" align="center"><label>
<input type="submit" name="Password" id="Password" value="Login">
</label></td>
</tr>
</table>
</form>
</body>
</html> -
Step 2
Create the ASP file in a new Notepad file with the following code lines. Give this file the name "ASP_Login.asp" and save it.
<%
Dim UserID
Dim Password
Dim AuthUser
Dim AuthPassword
UserID=Request.form("UserID")
Password=Request.form("Password")
AuthUser="Me"
AuthPassword="Eureka"
If UserID<>AuthUser then
Response.write("You have failed to enter a correct UserID and/or Password. Press the Back key on your browser to try again.")
else
Response.write("You have successfully logged in. Congratulations.")
end if
%> -
Step 3
Upload both files to your website. Use a browser to land on the "Login.html" page. First, input a random UserID and Password. You should then see the error message in Step 2. If you do not, then recheck the code for both files.
-
Step 4
Test the Login by going back to the HTMLl page and refreshing it. Enter "Me" for the UserID and "Eureka" as a password. Now you should see the congratulatory confirmation in Step 2. If you do not, then recheck the coding as above.








