×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Microsoft: FrontPage FAQ

Password Protection

Simple password protection using Javascript by liamm
Posted: 14 Apr 03 (Edited 1 Jul 03)

The following code creates a simple password login form. The password is the html name of the page you are linking to i.e. if you want to log into   "membersonly.html" the password you use would be "membersonly". Of course you can use any text before the .html. This isn't the most secure password protection but it is useful where serious security isn't an issue

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
How to call the page:
On your call from page insert the following -
<script language="JavaScript">
<!--//BEGIN Script

function new_window(url) {link = window.open(url,"Link","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=350,height=200,left=350,top=300");}
//END Script-->

</script>

Suppose the log-in page is in your 'Members' directory,the hyperlink address would be:-

javascript:new_window('members/login.htm')

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The code for your log-in form would be:-


<html>

<head><script Language="JavaScript">
<!--
function password(){
top.opener.parent.window.location.href=document.passform.passtext.value + ".htm"
window.close();
}
//-->
</script>


<title>Members Log In</title>
</head>

<body BGCOLOR="#C0C0C0" topmargin="10" leftmargin="10">

<p align="center"><font face="Verdana" size="1">To continue, please enter your Members'
Password:</font></p>

<form name="passform">
  <div align="center"><center><table border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td><font face="Verdana" size="1">Password:รก </font></td>
      <td><font face="Verdana" size="1"><input type="password" name="passtext" size="20"></font></td>
    </tr>
  </table>
  </center></div><div align="center"><center><p><font face="Verdana" size="1"><input
  type="button" value="  Enter  " onClick="password()"
  style="font-family: sans-serif; font-size: 8pt"></font></p>
  </center></div>
</form>
</body>
</html>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The page you are linking to needs to be in the same directory as your log-in page. Therefore multiple passwords can be used to log in to different pages. For example your log-in page is in the 'Members' directory. Also in the 'Members' directory are the pages admin.html and guest.html. You now have 2 password options for the other pages in your 'Members' directory, admin and guest.

Back to Microsoft: FrontPage FAQ Index
Back to Microsoft: FrontPage Forum


My Archive

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close