How do you make a page require a passord. for a form page

  • Thread starter Thread starter Guest
  • Start date Start date
DCS said:
I m trying to make an online form require a password. Any Help?

I recently set up an update form on the site below with a password - it is
the one to delete entries from the guestbook database.

It requires that you are on a server that allows ASP

The page is named "delete_password.asp". Make the name what you want, but
change the name on this line:
<form method="POST" action="delete_password.asp">
It must have an .asp exetension however.

The password is on this line:
If strPass = "mypassword" Then

Enter the code you want protected between
<!-- Start of main page content -->
and
<!-- End of main page content -->

Here is the code (cut down to the essentials):
<html>
<head></head>
<body>
<%
Dim strPass
strPass = Request.Form("strPass")
If strPass = "mypassword" Then
%>
<!-- Start of main page content -->
<!-- End of main page content -->
<% Else %>
<form method="POST" action="delete_password.asp">
Enter password here
<% If strPass <> "" Then %>
<p>
Incorrect Password<br />
Please Try again
</p>
<% End If %>
<p>
<input type="password" name="strPass" value="" size="20">
<input type="submit" value="Enter" name="B1">
</p>
</form>
<% End If %>
</body>
</html>
 
Back
Top