PDA

View Full Version : Java script help: please



edddie
08-25-2005, 02:22 PM
Hello everybody Iīm trying to understand what this means. Itīs like a Whats the word game and i donīt now the answer there for I ask you other computer understanding people.

<script type="text/javascript">
function login()
{
if (document.form.pw.value.substr(1, 7) == unescape("%68%65%78%65%64%70%77"))
{
alert('Correct password! Access granted!');
document.form.submit();
}
else
{
alert('Wrong password! Access denied!');
}
}
</script>
<form name="form" method="post">
Password: <input type="password" name="pw"> <input type="button" onClick="login();" value="Login">
</form>

What in goods name thoose this mean? wath is the word? :rolleyes:

if you know it. Please help me..

Twey
08-25-2005, 04:17 PM
It's "hexedpw."


<script type="text/javascript">
function login()
{
if (document.form.pw.value.substr(1, 7) == unescape("%68%65%78%65%64%70%77")) // if the second to eighth characters (string starts at 0) are equal to "hexedpw" (url encoded)
{
alert('Correct password! Access granted!'); // Tell the user they've passed
document.form.submit(); // Submit the form
}
else
{
alert('Wrong password! Access denied!'); // Tell the user they've failed
}
}
</script>
<form name="form" method="post">
Password: <input type="password" name="pw"> <input type="button" onClick="login();" value="Login">
</form>

edddie
08-26-2005, 02:51 PM
Hei I thoght it was that word too but it ainīt . I think it have something to do with de substr(1,7) thing.. What do you think?

Twey
08-26-2005, 03:04 PM
Read the comments. I put them there for a reason.

// if the second to eighth characters (string starts at 0) are equal to "hexedpw" (url encoded)

edddie
08-26-2005, 03:15 PM
That means? that the word is? I dont really undeerstand.. it is just 7 letters.... I am new on this Iám only 14 :rolleyes: :cool:

Twey
08-26-2005, 03:19 PM
The second to eighth characters of the password must be "hexedpw."
Put a character in front of it.

edddie
08-26-2005, 03:36 PM
Thank you very muck .. I did put an a before it and that was the thing.. Do you think you can help me with this one..

<script type="text/javascript">
var pw = prompt("Password?");
var nan = "wordpass";
if (pw.indexOf("s") == -1 && parseInt(pw) == 666)
{
alert('Correct password! Access granted!');
self.location = "/Hackerfight/?s=www&ss=testmissions&pw="+pw;
}
else
{
alert('Wrong password! Access denied!');
if (! confirm("Try again?"))
self.location = "/Hackerfight/";
else
self.location = "/Hackerfight/www/testmissions/";
}
</script>

This one I hardly understand do you know any thing about it? The word ...I mean..

Twey
08-26-2005, 04:12 PM
What you want is a Javascript tutorial.
http://www.w3schools.com/js/default.asp

It must not have s in it, and when run through the parseInt() function, it must return 666. This means it must start with "666." That might be the whole password, it might not. Further checking is done by a server-side script.

edddie
08-26-2005, 05:10 PM
Hei.. I have just a last question and I have wroten it upp.. If you can just tell me that one you are the best ( You alredy are the best..)