Password Direction

F

FlyBoy

Using the following javascript, on an intranet, using FP2003, W2K Server, I
want to direct the user to the page of the same file name as the password.
For anything else, I want the user directed to an error page. I've tried
several if\then statements, but can't get any to work.

Thanks in advance for the help.

Script:
<script language="JavaScript"><!--
function go() {
window.location.href = "" +
document.formName.passwordName.value + '.asp';
return false;
}
//--></script>
 
S

Steve Easton

The problem I see here is that anyone who can guess the "password" can open any page as there is no
"authentication."

Have you looked at this??

HOW TO: Apply Password Protection to Part of a Web Using FrontPage
http://support.microsoft.com/default.aspx?scid=kb;en-us;301554

It says FrontPage 2000 but it applies to all versions.


--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
........................with a computer
 
F

FlyBoy

Yes, I'm aware on the limitations. This is going to be on an intranet, access
limited to a slelect few users. Its not so much for security as it is for a
user specific redirection.

Thanks
 
J

Jens Peter Karlsen[FP MVP]

They will automatically get an error page if they type the wrong
password.
Since you use ASP anyway, why not handle the password issue in ASP? It
will be more secure.

Regards Jens Peter Karlsen. Microsoft MVP - Frontpage.
 
S

Steve Easton

Ok,

Then you need to create a variable. Then pass the name entered to the variable.
Then you need to concatenate the asp extension onto the variable:

Then have the script check for existence of the file and if it exists then execute the function with
the variable as the href

Something along these lines providing that the asp file is in the same location in the web as the
form page.

<script language="JavaScript">
<!--
var goto = "document.formName.passwordName.value";
goto = goto + '.asp';
function go() {
window.location.href = "goto"
return false;
}
//--></script>


--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
........................with a computer
 
S

Steve Easton

Oops, the variable needs to be inside the function instead of being global:

<script language="JavaScript">
<!--
function go() {
var goto = "document.formName.passwordName.value";
goto = goto + '.asp';
window.location.href = "goto"
return false;
}
//--></script>


--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
........................with a computer
 
F

FlyBoy

Thanks for everyone's help.

For anyone interested, here's what finally worked:
<input type="userid" name="text2">
<input type="password" name="text1">
<input type="button" value="Submit" name="Submit"
onclick=javascript:validate(text1.value,"password") >


<script language = "javascript">
function validate(text1,text2,text3,text4)
{
if (text1==text2 && text3==text4)
load('success.htm');
else
{
load('fail.htm');
}
}
function load(url)
{
location.href=url;
}
</script>
 

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