/ Published in: JavaScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<!-- ONE STEP TO INSTALL LOGIN CODER: 1. Add the first code into the BODY of your HTML document --> <!-- STEP ONE: Add the first code into the BODY of your HTML document --> <BODY> <center><table border=1> <tr><form name=members><td rowspan=4> <select name=memlist size=10 onChange="showmem(this.form)"> <!-- Original: Dion --> <!-- Web Site: http://www.iinet.net.au/~biab/ --> <!-- This script and many more are available free online at --> <!-- The JavaScript Source!! http://javascript.internet.com --> <!-- "member name | password | destination pagename |" --> <option selected value="John Smith|password|mainpage|">John Smith <option value="Peter Jones|theirpwd|endpages|">Peter Jones <option value="Sue Brown|asdfvcxz|nowheres|">Sue Brown <option value="Sally West|zaqxswde|logintop|">Sally West </select></td> <td align=right>User:</td><td><input type=hidden value="0" name=entry> <input type=text name=memname size=8 value=""></td></tr> <tr><td align=right>Password:</td><td><input type=text name=password size=8 maxlength=8><font size="-1"><-- Must be exactly 8 characters</font></td></tr> <tr><td align=right>Page Name:</td><td><input type=text name=pagename size=8 maxlength=8><b>.html</b><font size="-1"><-- Must be exactly 8 characters</font></td></tr> <tr><td colspan=2 align=center> <input type=button value="New User" onclick="addnew(this.form);"> <input type=button value="Delete User" onclick="delthis(this.form);"> <input type=button value="Update/Show Coding" onclick="update(this.form); create(this.form);"></td></tr> <tr><td colspan=3 align=center> <input type=text size=60 name=message value="Note: Password/Page Name must be exactly 8 letters! (a-z)"> <input type=hidden name=num value=1></td> </form></tr> </table> <hr size=2 width=75%> <form name=js><textarea cols=75 rows=10 name=scrpt wrap=virtual> <SCRIPT LANGUAGE="JavaScript"> <!-- Begin var params=new Array(4); var alpha="ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHI"; function check(form) { which=form.memlist.selectedIndex; choice = form.memlist.options[which].value+"|"; if (choice=="x|") { alert("Please Select Your Name From The List"); return; } p=0; for (i=0;i<3;i++) { a=choice.indexOf("|",p); params[i]=choice.substring(a,p); p=a+1; } h1=makehash(form.pass.value,3); h2=makehash(form.pass.value,10)+" "; if (h1!=params[1]) { alert("Incorrect Password!"); return; }; var page=""; for (var i=0;i<8;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+=26; page+=alpha.substring(a,a+1); }; top.location=page.toLowerCase()+".html"; } function makehash(pw,mult) { pass=pw.toUpperCase(); hash=0; for (i=0;i<8;i++) { letter=pass.substring(i,i+1); c=alpha.indexOf(letter,0)+1; hash=hash*mult+c; } return(hash); } // End --> </script>
URL: http://javascript.internet.com/passwords/login-coder.html