JavaScript Challenge 1 :: Function understanding
by Arxleol on Wednesday 27.01.2010, under hellboundhackers.org, javascript, tutorial
As always first challenges are the easiest ones. And first java challenge is no different from that assumption.
From the source code of login button:
<input onclick="pasuser(this.form)" type="button" value="Login" />
Value of attribute onclick is in fact call to javascript function pasuser with form itself as parameter.
Function pasuser can be found few lines of code upper then form submit button. Contents are here:
<!-- function pasuser(form) { if (form.id.value=="partyhard2") { if (form.pass.value=="lifeisshort1") { location="index.php?user=partyhard2&pass=lifeisshort1" }else { alert("Invalid Password") } }else{ alert("Invalid UserID") } } //-->
First if statement checks whether id is correct and in our case it should be partyhard2.
Second statement check whether password is correct and in this case password should be lifeisshort1.