How do I password protect just a page or folder

B

Brig

Newbie here.

How can I prompt a user to enter a username & password ( That I will
provide) when they access a page on our website.

We have an enrollment form that I want to post on our web that only certain
people should have access to.

Is ther a way to do this?

Thank you very much.
 
J

Jim Buyens

The best approach is to create a subweb containing the one
page, and then secure it as described at:

Securing Web Pages With Windows Authentication
http://www.interlacken.com/winnt/tips/tipshow.aspx?tip=34

If that's not possible, here's a simple ASP page that
checks for a username of gotta and a password of secret.

<html>
<head>
<title>Secure Page</title>
</head>
<body>
<h1 align="center">Secure Page</h1>
<form method="POST">
<table border="0" cellpadding="2" cellspacing="0">
<tr>
<td>Username</td>
<td><input type="text" name="txtUser" size="20"
value="<%=request.form("txtUser")%>"></td>
</tr>
<tr>
<td>Password</td>
<td><input type="password" name="txtPswd" size="20"
value="<%=request.form("txtPswd")%>"></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><input type="submit" value="Submit"
name="btnSub"></td>
</tr>
</table>
<%
if ("" & request.form("txtUser") <> "gotta") _
or ("" & request.form("txtPswd") <> "secret") then
response.write _
"<p>Enter correct username and password.</p>" & _
vbcrlf & _
"</form>" & vbcrlf & _
"</body>" & vbcrlf & _
"</html>" & vbcrlf
response.end
end if
%>
<p>The secured content goes here.</p>
</form>
</body>
</html>

Jim Buyens
Microsoft FrontPage MVP
http://www.interlacken.com
Author of:
*----------------------------------------------------
|\---------------------------------------------------
|| Microsoft Office FrontPage 2003 Inside Out
||---------------------------------------------------
|| Web Database Development Step by Step .NET Edition
|| Microsoft FrontPage Version 2002 Inside Out
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/---------------------------------------------------
*----------------------------------------------------
 
Top