Full version: jsB@nk » Security » Passwordor » Enhanced Login Javascript Test
URL: https://www.javascriptbank.com/enhanced-login-javascript-test.html
This 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. This script uses Array to keep data of users. And Usernames and passwords are case sensitive.
Full version: jsB@nk » Security » Passwordor » Enhanced Login Javascript Test
URL: https://www.javascriptbank.com/enhanced-login-javascript-test.html
<script language="javascript"> // called by the current pagelook=new Array(new Array("user01","pass01"),new Array("user01","pass02"));</script><script language="javascript"><!--function go(){var user = document.form.user.value;var pass = document.form.pass.value;if ( user == "" && pass == "" ){ alert("Invalid Username or Password!"); // Put your own message here}else { isfound=false;okpass=""for (i = 0; i < look.length; i++){ if (user==look[i][0]){ okpass=look[i][1];isfound=true;break; }}if (okpass==""){ alert("Invalid Username or Password!"); // Put your own message here }else { if (!isfound) { alert("Invalid Username or Password!"); // Put your own message here }else { if (okpass != pass) { alert("Invalid Username or Password!"); // Put your own message here} else { location = user.toLowerCase() + "/" + pass.toLowerCase() + ".html"; //YOU MUST HAVE A FOLDER THAT CONFORMS TO THE USERNAME ENTRY!!}}}}}//--></script><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->
Use "user01" as user name and "pass01" as password, or "user02" and "pass02". Try putting in something else and see!<p>Usernames and passwords are case sensitive! Lower case only!!</p><form name="form"><font face="verdana"><table border="0"><tbody><tr><td><font face="verdana">Username:</font></td><td><input type="text" name="user" size="15"></td></tr><tr><td><font face="verdana">Password:</font></td><td><input type="password" name="pass" size="15"></td></tr><tr><td></td><td align="center"><input type="button" value="Login" name="login" onclick="go()"><input type="reset" value="Reset"></td></tr></tbody></table></font></form><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->