|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
i recently found a java script game that could read keystrokes. i am wanting to have a "secret" webpage that can only be accessed if someone enters a password, but do not want a password box. is it possible to read the keystrokes and if they type the password then the "secret" page will appear?
thanks |
|
#2
|
|||
|
|||
|
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by loagan:
i recently found a java script game that could read keystrokes. i am wanting to have a "secret" webpage that can only be accessed if someone enters a password, but do not want a password box. is it possible to read the keystrokes and if they type the password then the "secret" page will appear? thanks[/quote] Assuming you want to write the thing in JavaScript, the source would have to be in the html or in an public accessable scriptfile, thus revealing all your secrets and leaving the password protection quite unusable... unless of course you do the validation server-side, after a certain combination og keystrokes submits something... uhh... I'm not quite sure how I would do it though. |
|
#3
|
|||
|
|||
|
I agree completely with chris. Using javascript for password protection is not a good idea, but... if you want to play around with it put this page in your favorite HTML editor and have fun...
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre> <html> <head> <script language="JavaScript"><!-- var Keys=new Array; var KeyASC=new Array; function RecordKeys() { x=event.keyCode Keys[Keys.length]=x document.all.showm.value=Keys.length } function ShowList() { var list=open("","","width=300,height=600,scrollbars=1") list.document.write("<style><!--table{font-size:10px;font-family:Arial}--></style>") list.document.write("<table bgcolor=000000><tr><td><table>") for (i=1;i<256;i++) { if (i<10) { i="0" + i //this should make 2 digits. } letter=i.toString(16) letter=unescape('%' + letter) list.document.write("<tr bgcolor=ffff00><td>PRESS THIS KEY: " + letter + "</td><td> GET THIS NUMBER: " + i + "</td></tr>") } list.document.write("</table></td></tr></table>") } function ShowRecord() { //decode to letters and display them just for the heck of it... for(i=0;i<Keys.length;i++) { y=Keys[i].toString(16) //this converts the key code to hex KeyASC[i]=unescape('%' + y) //this converts the hex code to a string } document.all.showm.value=KeyASC.join(""); var entered=Keys.join("") var password=open("","","width=250,height=100") password.document.write("<style><!--table{font-size:14px;font-family:Arial;}--></style>") if (entered=="979899") //right now the password is "abc" use the key list to figure out what you want it to be. { password.document.write("<body bgcolor=000000><table bgcolor=00ff00 width=100% height=100%><tr><td align=center><b>Password Accepted</b></td></tr></table>") } else { password.document.write("<body bgcolor=000000><table bgcolor=ff0000 width=100% height=100%><tr><td align=center><b>Password Not Accepted</b></td></tr></table>") } } //--></script> <style><!-- table { font-family:Arial; font-size:10px; } button { width:150; background-color:ffff00; border:5px solid #000000; } #showm { width:150; background-color:ffff00; border:5px solid #000000; } --></style> <title>RecordKeys</title> </head> <body onkeypress="RecordKeys()" bgcolor=0099ff> <table bgcolor=ffaa00><tr><td> <table> <tr><td> <input type=text id=showm> </td></tr> <tr><td> <button onclick="ShowRecord()">SHOW RECORD</button> </td></tr> <tr><td> <button onclick="ShowList()">SHOW KEY CODES</button> </td></tr> </table> </td></tr></table> </body> </html> [/code] |
|
#4
|
|||
|
|||
|
thanks for the replies
i am not too woried about the level of protection. i just wanted a way for friends to access a hidden page so i dont have to have a link. any more suggestions would be helpful. PS. i am dealing with an isp that does not allow server side scripting! URL |
![]() |
| Viewing: Dev Shed Forums > Web Design > HTML Programming > hidden password protection possible? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|