HTML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignHTML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 14th, 2000, 01:01 AM
loagan loagan is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2000
Posts: 2 loagan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #2  
Old July 14th, 2000, 12:15 PM
chrris chrris is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2000
Location: Aalborg, Denmark
Posts: 9 chrris User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to chrris
<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.

Reply With Quote
  #3  
Old July 14th, 2000, 01:58 PM
billyo billyo is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Posts: 114 billyo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
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]

Reply With Quote
  #4  
Old July 14th, 2000, 11:05 PM
loagan loagan is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2000
Posts: 2 loagan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignHTML Programming > hidden password protection possible?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway