password protection

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to use FP2003 to prompt a user for a Password ONLY to view a
certain page. I don't want to make them register or anything.. Just as long
as they know the password, they can get in. I sww the ASP pages but that
makes it sound like eveyone has their own username and password. I want one
password for everyone. I know it can be done.

I found some code on the net earlier, but I cant find it again. It propted
me to type in a password and then it generated the html to paste into my
site. It worked OK, but it loaded the page and THEN asked me for the
Password. It also let me choose a page to send allt he people who entered
the wrong password too.. Help!
 
See http://support.microsoft.com/default.aspx?scid=kb;en-us;825451
Your host will have to support subwebs and unique permissions under the FP Server Extensions

--




|I am trying to use FP2003 to prompt a user for a Password ONLY to view a
| certain page. I don't want to make them register or anything.. Just as long
| as they know the password, they can get in. I sww the ASP pages but that
| makes it sound like eveyone has their own username and password. I want one
| password for everyone. I know it can be done.
|
| I found some code on the net earlier, but I cant find it again. It propted
| me to type in a password and then it generated the html to paste into my
| site. It worked OK, but it loaded the page and THEN asked me for the
| Password. It also let me choose a page to send allt he people who entered
| the wrong password too.. Help!
 
Justin -
If your host supports asp, put a form on a login page (say gateway.htm or whatever) like this.
<form method="POST" action="private.asp">
Enter your password to get to my secret site.</p>
<p><input type="text" name="T1" size="20"><input type="submit" value="Submit"
name="B1"><input type="reset" value="Reset" name="B2"></p>
</form>

At the very top(before any HTML tags) of private.asp put this
<%
if request.form("T1") <> "Password" then
response.redirect a.htm
end if
%>

Make the password and page names whatever you want. If someone can get to the source for
the asp page, then of course they can get the password, but it should be OK for the
majority. I think (but not sure) it's pretty safe it you put it in the _private folder.

This uses a password of Password. It's case sensitive, so be sure your authorized users
have it correct.
MikeR
 
will users have individual passwords? or just *the same* password for all
users?

if so, then you could simply put a one field, one value access database
online, and a simple query

if this value equals that value then go to this page.

the code below is just using the form field validation - it does the job,
but the password value is visible in the source, so it is not so secure.

<form method="POST" action="--WEBBOT-SELF--">
<!--webbot bot="SaveResults" U-File="file:///F:/Documents and
Settings/Andrew Murray/My Documents/My Webs/Andrew
Web/_private/form_results.csv" S-Format="TEXT/CSV" S-Label-Fields="TRUE" -->
<p>
<!--webbot bot="Validation" S-Data-Type="String" B-Value-Required="TRUE"
S-Validation-Constraint="Equal to" S-Validation-Value="password" -->
<input type="password" name="password" size="20"><input type="submit"
value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p>
</form>


You could probably do it with javascript or something.

like 'onsubmit="checkpassword();"

<script>
function checkpassword()
{
if form1.textbox.value = "password"
{ open.window (passwordpage.htm)
}
else
{ alert="Sorry! wrong password..."
}
}

</script>

Not saying this is totally correct script; but something like that.

put that code in a password.js file and called it from an external link

like
<script src="password.js" language="javascript">
 
Back
Top