JavaScript help ...

Help with html/xhtml, css, javascript and other related topics.

Moderator: Moderators

JavaScript help ...

Postby webnoobie on Fri May 26, 2006 12:48 am

Greetings,

I just need an explanation about the code below from one of you JS experts. And, would anyone perhaps know what the password would be?

Code: Select all
<script language=JavaScript>
var base= new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z","a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z");
var key=new Array(3);
var i;
base.reverse();
for (i=0; i<= 3;++i)
   {
   key[i] = new Array(2);
   }
key[0][0]=base[41];
key[0][1]=base[21];
key[1][0]=base[1];
key[1][1]=base[3];
key[2][0]=base[11];
key[2][1]=base[8];
key[3][0]=base[22];
pass=prompt("Please enter the Password: ","");
if (pass==key.join(",")){
window.location.href="index.php?pw="+pass;
}
</script>
Best Regards:
webnoobie
webnoobie
Registered User
Registered User
 
Posts: 366
Joined: Wed Jun 08, 2005 10:38 pm
Location: My Computer

Postby DooBDee on Fri May 26, 2006 8:17 am

Dont use JS for passwords. Its potentially insecure, thus use PHP instead. Remember that users can disable javascript - they cant php.
DooBDee
Website Ninja
DooBDee.net
User avatar
DooBDee
Moderator
Moderator
 
Posts: 3530
Joined: Tue Mar 01, 2005 6:28 pm
Location: DooBDee.net

Postby webnoobie on Sat May 27, 2006 6:16 am

Hehehe. I know doobdee. This just for a website that has simple little 'hacking' challenges. But, I figured out what the password was anywho. :D
Best Regards:
webnoobie
webnoobie
Registered User
Registered User
 
Posts: 366
Joined: Wed Jun 08, 2005 10:38 pm
Location: My Computer


Return to (X)HTML Coding

Who is online

Users browsing this forum: No registered users and 1 guest