G
Guest
Anyone have any suggestions on how to get asp password protected webpages to
work? The code I have doesn't seem to work.
Thanks.
work? The code I have doesn't seem to work.
Thanks.
Jennifer said:Anyone have any suggestions on how to get asp password protected
webpages to work? The code I have doesn't seem to work.
Thanks.
Trevor L. said:Jennifer said:Anyone have any suggestions on how to get asp password protected
webpages to work? The code I have doesn't seem to work.
Thanks.
This is the page I invoke when deleting records from a DB.
If "mypassword" is entered, then the page "delete_from_guestbook.asp" is
called
If nothing is entered, then the page stays the same.
If an incorrect password is entered, then a prompt is given to enter the
correct password.
Because the password is in ASP, it is invisible to users.
There may be better ways, but it seems to work
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Guestbook Delete - Password Page</title>
<!-- External CSS Files -->
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<div align="center">
<h3>Trevor L.s Guestbook</h3>
<h4>Delete Comment - Password</h4>
<%
Dim strPass
strPass = Request.Form("strPass")
If strPass = "mypassword" Then
%>
<script type="text/javascript">
location.href="delete_from_guestbook.asp"
</script>
<% Else %>
<form method="POST" action="delete_password.asp">
<span class="subheading">Enter password to go to delete page
<% If strPass <> "" Then %>
<p>
Incorrect Password<br />
Please Try again
</p>
<% End If %>
</span>
<p>
<input type="password" name="strPass" value="" size="20" class="inbox">
<input type="submit" value="Enter" name="B1" class="button">
</p>
</form>
<% End If %>
<p>
<input type="button" value="Back" onclick="history.back()">
</p>
</div>
</body>
</html>
--
Cheers,
Trevor L.
[ Microsoft MVP - FrontPage ]
MVPS Website: http://trevorl.mvps.org/
Jennifer said:I don't need to delete records from a DB. I have a DB that asks for user
name and password via asp code, and that works fine, but the code given
to me
to make other pages protected and accessed only by views after they have
successfully logged in doesn't work.
I used the code at this link:
http://support.microsoft.com/default.aspx?scid=kb;en-us;825498
and used this part of the code:
. Password-protect other Web pages: To password-protect another Web page
in
your Web site, you must save the file with an ASP file name extension,
for
example, Mypage.asp, and then add the following two lines to the very top
of
the file: <% @language="vbscript" %>
<!--#include virtual="/logon/_private/logon.inc"-->
The first line specifies that you are using Microsoft Visual Basic
Scripting
Edition (VBScript) for your scripting language, and the second line
includes
the user name and the password functionality from the logon include file
that
you created earlier.
But it still doesn't work.
Jennifer
Trevor L. said:Jennifer said:Anyone have any suggestions on how to get asp password protected
webpages to work? The code I have doesn't seem to work.
Thanks.
This is the page I invoke when deleting records from a DB.
If "mypassword" is entered, then the page "delete_from_guestbook.asp" is
called
If nothing is entered, then the page stays the same.
If an incorrect password is entered, then a prompt is given to enter the
correct password.
Because the password is in ASP, it is invisible to users.
There may be better ways, but it seems to work
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<title>Guestbook Delete - Password Page</title>
<!-- External CSS Files -->
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<div align="center">
<h3>Trevor L.s Guestbook</h3>
<h4>Delete Comment - Password</h4>
<%
Dim strPass
strPass = Request.Form("strPass")
If strPass = "mypassword" Then
%>
<script type="text/javascript">
location.href="delete_from_guestbook.asp"
</script>
<% Else %>
<form method="POST" action="delete_password.asp">
<span class="subheading">Enter password to go to delete page
<% If strPass <> "" Then %>
<p>
Incorrect Password<br />
Please Try again
</p>
<% End If %>
</span>
<p>
<input type="password" name="strPass" value="" size="20"
class="inbox">
<input type="submit" value="Enter" name="B1" class="button">
</p>
</form>
<% End If %>
<p>
<input type="button" value="Back" onclick="history.back()">
</p>
</div>
</body>
</html>
--
Cheers,
Trevor L.
[ Microsoft MVP - FrontPage ]
MVPS Website: http://trevorl.mvps.org/
Ronx said:The path to the logon,inc is logon/_private/logon.inc
Is this the correct path? (I think probably not)
Change the include comment to
<!--#include virtual="/path/logon.inc"-->
where path is the folder or path leading to the folder containing your file
named logon.inc
If logon.inc is in the root folder, then use
<!--#include virtual="/logon.inc"-->
--
Ron Symonds - Microsoft MVP (FrontPage)
Reply only to group - emails will be deleted unread.
FrontPage Support: http://www.frontpagemvps.com/
Jennifer said:I don't need to delete records from a DB. I have a DB that asks for user
name and password via asp code, and that works fine, but the code given
to me
to make other pages protected and accessed only by views after they have
successfully logged in doesn't work.
I used the code at this link:
http://support.microsoft.com/default.aspx?scid=kb;en-us;825498
and used this part of the code:
. Password-protect other Web pages: To password-protect another Web page
in
your Web site, you must save the file with an ASP file name extension,
for
example, Mypage.asp, and then add the following two lines to the very top
of
the file: <% @language="vbscript" %>
<!--#include virtual="/logon/_private/logon.inc"-->
The first line specifies that you are using Microsoft Visual Basic
Scripting
Edition (VBScript) for your scripting language, and the second line
includes
the user name and the password functionality from the logon include file
that
you created earlier.
But it still doesn't work.
Jennifer
Trevor L. said:Jennifer wrote:
Anyone have any suggestions on how to get asp password protected
webpages to work? The code I have doesn't seem to work.
Thanks.
This is the page I invoke when deleting records from a DB.
If "mypassword" is entered, then the page "delete_from_guestbook.asp" is
called
If nothing is entered, then the page stays the same.
If an incorrect password is entered, then a prompt is given to enter the
correct password.
Because the password is in ASP, it is invisible to users.
There may be better ways, but it seems to work
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<title>Guestbook Delete - Password Page</title>
<!-- External CSS Files -->
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<div align="center">
<h3>Trevor L.s Guestbook</h3>
<h4>Delete Comment - Password</h4>
<%
Dim strPass
strPass = Request.Form("strPass")
If strPass = "mypassword" Then
%>
<script type="text/javascript">
location.href="delete_from_guestbook.asp"
</script>
<% Else %>
<form method="POST" action="delete_password.asp">
<span class="subheading">Enter password to go to delete page
<% If strPass <> "" Then %>
<p>
Incorrect Password<br />
Please Try again
</p>
<% End If %>
</span>
<p>
<input type="password" name="strPass" value="" size="20"
class="inbox">
<input type="submit" value="Enter" name="B1" class="button">
</p>
</form>
<% End If %>
<p>
<input type="button" value="Back" onclick="history.back()">
</p>
</div>
</body>
</html>
--
Cheers,
Trevor L.
[ Microsoft MVP - FrontPage ]
MVPS Website: http://trevorl.mvps.org/