1) Script Title: Encrypted Password script
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex9/password.htm
3) Describe problem:
I was wondering how I could change it to one field, as I dont need a username just a pssword field.
1) Script Title: Encrypted Password script
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex9/password.htm
3) Describe problem:
I was wondering how I could change it to one field, as I dont need a username just a pssword field.
Here you go:
Hope this helps.Code:<script type="text/javascript"> //Encrypted Password script- By Rob Heslop //Script featured on Dynamic Drive //Visit http://www.dynamicdrive.com function submitentry(){ password = document.password1.password2.value.toLowerCase() passcode = 1 for(i = 0; i < password.length; i++) { passcode *= password.charCodeAt(i); } //CHANGE THE NUMBERS BELOW TO REFLECT YOUR PASSWORD if(passcode==126906300) //CHANGE THE NUMBERS ABOVE TO REFLECT YOUR PASSWORD { window.location=password+".htm"} else{ alert("password incorrect")} } </script> <form name="password1"> <strong>Enter password: </strong> <input type="password" name="password2" size="15"> <input type="button" value="Submit" onClick="submitentry()"> </form>
"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design
Thank you very much Ill try it out and get back to you.
Hi I have tried this and it doesnt work has anyone else got any ideas or know of another script that might work.
The script works well with a single field as thetestingsite furnished but you need to do the following things to make this script run:
1. First you need to calculate the encrypted value of your password (step 1 mentioned in the script page).
2. Copy that value and paste that value in the JS code in the following manner:
3. Next thing you need to have a page whose name is equivalent to your original password (not the encrypted value) and according to the script this file extension is .htm. If you want to open a file with another extension then you need to change the following line:Code:if(passcode==your_encrypted_value_goes_here)
4. Last but not the least the name of your form and the password field should be password1 and password2 respectivelyCode:window.location=password+".htm"
.htm can be replaced with your file name extension.
If you follow these items then the script should work without any problems.
Bookmarks