Password protestion w/o cPanel or Permissions

G

Guest

I apologize if you've been asked this dozens of times, but I can't find the
answer. My host does NOT allow more than one FP user per site and they don't
have cPanel. So how can I password protect a subweb or folder or group of
pages or whatever? I do NOT need to store multiple users and passwords, but
I don't want it to be visible in "View Source" either. I simply need to
establish a single user with a single password.

I've tried using this ASP script above the <html> with an If-Then-Else.
<%
<script="Login"
If Request.Form("username") = "Usrnme" AND Request.Form("password") =
"stdpwd" Then
Response.Redirect "http://www.my_web/private_section/_home.htm"
Else
Response.Redirect "http://www.my_webt/bogus.htm"
End If
End script>
%>

But I don't know how to call it from the "Login" button on the html page.
Also, an FP interactive button does not seem to recognize the page if I call
it login.asp, but it goes there if it is named login.htm.

I've searched Help, Microsoft, the web, etc. I get bits and pieces of info,
but no info as to how I'm supposed to string it together to make it work.

So my questions are: is the script wrong? If it's okay, where and how do I
call it in the form? Is there anything else necessary to make it work and
keep it relatively secure.

Thank you,

Laura Douglas
 
T

Thomas A. Rowe

You would create a form in FP and then set the form action to go to the page containing the script
below.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
 
G

Guest

But that's my problem. I've got the page - login.htm. It has the form. But
I don't know what to do to get it to to call the script or send the user
anywhere. How do you "set a form action?" I'm using Send to other (custom
.... ASP Script); form name is Login.asp. Have created a separate file named
login.asp with the script. Options: Action: "Login.asp"; Method: "GET";
Encoding type: "ASP"

Still doesn't work. So I'm still doing something wrong or stupid. Please
remember I'm a novice at this so I probably need to have things explained as
if to a child. Sorry.

Thanks,

Laura
 
T

Thomas A. Rowe

Step 1: Content of login.asp

<html>
<head>
<title>login page</title>
</head>
<body>
<form method="POST" action="verify.asp">
<p>User Name: <input type="text" name="username" size="20"></p>
<p>Password: <input type="text" name="password" size="20"><br>
<input type="submit" value="Submit" name="B1"></p>
</form>
</body>
</html>




Step 2: Content of verify.asp

<%
If Request.Form("username") = "Usrnme" AND Request.Form("password") = "stdpwd" Then
Session("Authenticated") = 1
Response.Redirect "http://www.my_web.com/private_section/home.asp"
Else
Session("Authenticated") = 0
Response.Redirect "http://www.my_web.com/bogus.asp"
End If
%>



Step 3: ALL pages to be protected by the login script in the private_section folder, must have a
..asp extension and the following code added to the top of each page before the opening <html> tag.

This is what need to be at the top of home.asp

<%
If Session("Authenticated") <> 1 Then
Response.Redirect "http://www.my_web.com/bogus.asp"
End If
%>
<html>

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
 
T

Thomas A. Rowe

Paste Step1 and Step2 from the my post at 7:27 PM to notepad, then into a completely blank page
(delete everything off the page first, that FP creates when you select a new page) in HTML/Code
view.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
 
G

Guest

Thank you so much, Thomas, for the clarification. Now I have 2 questions.
1. Can I use my template rather than a completely blank login page? If so,
can I put the form inside a table as usual? Are there any changes I have to
make to the HTML you posted?
2. If I use a FP button to link to the login.asp from an HTML page, I get
the "Page cannot be displayed." error. The same happens if I simply put a
hyperlink to login.asp in text. How can I get an HTML page to link to an ASP
page?

BTW, you are a godsend! Thank you so very much.

Laura
 
T

Thomas A. Rowe

Yes, but use the blank page first, so that you know that everything is working correctly, then you
move the code to your template.

Does your server support ASP?

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
 
G

Guest

Yes, my server supports ASP. They say it is automatically enabled with all of
the Windows hosting accounts they offer.

Okay, I've got the login.asp and the verify.asp. When I try it out in the
browser, I still get an HTTP 500 - Internal server error showing "The page
cannot be displayed." In the address it shows as verify.asp. But it doesn't
seem to go to the page indicated for either 1 or <>1 authentication. I've
checked the file names and locations in verify.asp and they are correct.

So that means I'm still doing something wrong. Aaaarrrrrgggghhhh!

I really appreciate all this help. I'm feeling very ignorant.

Laura
 
T

Thomas A. Rowe

Laura, send me an email via the email address I use to post here.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
 
G

Guest

Thomas, I don't know what you did or whom you beat over the head, but
everything is working perfectly now. You are a genius! Just wanted everyone
to know. Thank you so very much!!!!!!!

Laura
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top