»
EnglishFrenchVietnamese

Print - BCR PassWord Box - JavaScriptBank.com

Full version: jsB@nk » Security » Encryption » BCR PassWord Box
URL: https://www.javascriptbank.com/bcr-password-box.html

BCR PassWord Box © JavaScriptBank.comThis is a simple password script that requires both a login and password to gain entry to the protected page, with an incorrect set taking the user to a 'failure' page instead.

Full version: jsB@nk » Security » Encryption » BCR PassWord Box
URL: https://www.javascriptbank.com/bcr-password-box.html



JavaScript
<script type="text/javascript" language="JavaScript">/*******************************//****    BCR PASSWORD BOX   ****//***    FREEWARE JS SCRIPT   ***//**     Fell free to edit     **//* But Please send ideas to me *//**   at  [email protected]   **//*** IF USED ON YOUR WEBSITE ***//**** SEND ME AN E-MAIL AND ****//*****  GIVE ME THE CREDIT *****//******    E-mail me at   ******//*****  [email protected]  *****//*******************************//*To add/change users & Passwords just change the users array and passwords were it tells you.You can have as many/little as you like When you add a new user be sure to add a Pass wordso a new user would look like" users[7] = 'username'; pass[7] = 'password' "(without "s)REMEMBER: Usernames & Passwords are case sensative so 'pass'is differnt to 'Pass' & 'PaSs'*/// -------- Set Vars -----------var users = new Array()var pass = new Array()users[0] = 'Admin'; pass[0] = 'Pass'//Leave this Username for Webmaster (you) but change password//Add/change user names here & Add/chage passwords hereusers[1] = 'User1'; pass[1] = 'Pass1'//User1 name & passwordusers[2] = 'User2'; pass[2] = 'Pass2'//User2users[3] = 'User3'; pass[3] = 'Pass3'//User3users[4] = 'User4'; pass[4] = 'Pass4'//ectusers[5] = 'User5'; pass[5] = 'Pass5'users[6] = 'User6'; pass[6] = 'Pass6'var wrighturl = 'pass.htm'//Page you want the user to go to if Password is wrightvar wrongurl = 'wrong.htm'//  "   "   "    "   "   "  "  "  "    "   "  "  wrong//-----------------------------------------//----------- Leave this alone ------------function isPass(){var dn = document.nameenteruserN = dn.usern.valuepassV = dn.pass.valueif (userN.length < 1){ alert('Enter Username'); return false }if (passV.length < 1){ alert('Enter Password'); return false }for (var i = 0; i < users.length ; i++){if (users[i] == userN && pass[i] == passV){ location.href = wrighturl; return false}if (users[i] == userN && pass[i] != passV){ location.href = wrongurl; return false}}location.href = wrongurl}function list(){userO=window.open('about:blank','winID','height=400,width=200,top=100,left=100,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no')userO.document.write('<u><big> List Of Users </big></u><br> \n')for (var u = 0; u < users.length; u++){userO.document.write(' &raquo; ' + users[u] + "<br> \n")}userO.document.write('<a href="javascript:window.close()"> Close </a>')}//------------------------------------------//------------------------------------------//       DISCLAIMER// USE SCRIPT AT OWN RISK</script><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<form name="nameenter"><table border="3"><thead><tr><td>Username:<input type="text" name="usern" size="20"><br>PassWord:<input type="password" name="pass" size="20"><input type="button" value="Enter" onclick="isPass()"><br><input type="button" value="List Users" onclick="list();"><br>(user name is &#39;User1&#39; and password is &#39;Pass1&#39;, case sensitive.)</td></tr></thead></table></form><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->