Menu: Home | GuestBook | Photos | Links | ICQ | Projects | Tech | Mail
Downloads | Programs | Eamons | Freemans | Tristans | Atomic MPC


Here is a similar program I used to use password protect the Photos section of this site. (Not any more)
The user inputs the username and password, a value for each is calculated by adding the characters value of each input.
so jim = (j =106 ) + (i =105 ) + (m=109 ) = 320
This is then checked and if both the username and password values match the values in the code then the user enters the password protected page. you will need to also the javascript that encrypts the usernames and password, here is an example encrypt.html, view the source for the code.


function authenticate(){
   //User Inputs
   usernamea = document.input1.user1.value.toLowerCase()
   passworda = document.input1.pass1.value.toLowerCase()

   // variablies for storing added character values
   var user = pass = 0

   //Password total value
   for(j=0;j<passworda.length;j++) {
      pass+= passworda.charCodeAt(j);
   }

   //Username total value
   for(k=0;k< usernamea.length; k++) {
      user += usernamea.charCodeAt(k);
   }

   //Input values of the password and username that is valid
   if (pass==754&&user==428)
   {
      window.location=passworda+".html"
   }else{
      alert("BUNG!!!\n Wrong answer McFly, try again...")
   }
}
<form name="input1">
Username: <input type="text" name="user1">
Password: <input type="password" name="pass1">
<input type="button" onclick="authenticate()" value="Submit"> <input type="reset" value="Reset"> </form>