Put this code in your BODY section. You only have to do that once, because it never changes. <script language="JavaScript"><!-- var params=new Array(4); var alpha="0123456789-ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-ABCDEFGHIJKLMNOPQRSTUVWXYZ"; function check() { unam = login.memlist.value+"|"; if (unam == " |" || unam == "|") { alert("Please type your username"); return; } p=0; for (i=0;i<maxusers;i++) { a=users[i].indexOf("|",p); if (login.memlist.value == users[i].substring(a,p)) { p = i+1; break; } } if (p != 0) { choice = users[p-1]; } else { alert("Unknown username!"); return; } p=0; for (i=0;i<3;i++) { a=choice.indexOf("|",p); params[i]=choice.substring(a,p); p=a+1; } h1=makehash(login.pass.value,3); h2=makehash(login.pass.value,10)+" "; if (h1!=params[1]) { alert("Incorrect Password!"); return; } var page=""; for (var i=0;i<10;i++) { letter=params[2].substring(i,i+1) ul=letter.toUpperCase(); a=alpha.indexOf(ul,0); a-=(h2.substring(i,i+1)*1); if (a<0) a+=37; page+=alpha.substring(a,a+1); }; top.location=page.toLowerCase()+".html"; } function makehash(pw,mult) { pass=pw.toUpperCase(); hash=0; for (i=0;i<10;i++) { letter=pass.substring(i,i+1); c=alpha.indexOf(letter,0)+1; hash=hash*mult+c; } return(hash); } // --> </script> <center> <form name=login action="javascript:check();"> <table border=0 cellpadding=3> <!-- Based on: Login Coder by Dion --> <!-- Modified: Marc Vos --> <!-- Web Site: http://www.vos.net/marc/ --> <!-- This script and many more are available free online at --> <!-- The JavaScript Source!! http://javascript.internet.com --> <tr><td>Username:</td><td><input type=text size=40 maxlength=38 name=memlist></td></tr> <tr><td>Password:</td><td><input type=password size=40 maxlength=10 name=pass></td></tr> <tr><td colspan=2 align=center><input type="submit" value="Login"></td> </tr></table></form> </center>
Free JavaScripts provided by The JavaScript Source