It looks like you're new here. If you want to get involved, click one of these buttons!
//Challenge four
function display_error(pi,one,two)
{
try
{
if (pi==\"31415\")
throw \"line1\";
else
throw \"line2\";
}
catch(co)
{
if(co==\"line1\")
{
var x=prompt(two,\"\");
return x;
}
if(co==\"line2\")
{
alert(one);
return \"\";
}
}
}
var lol=\"test123\";
function get_user()
{
var name=prompt(\"Username:\",\"\");
var error=\"Sorry, wrong username\";
var password=\"Password:\";
if(display_error(name,error,password)==lol)
{
alert(\"Welcome, \" + name);
//add points for completing challenge
window.location=\"http://www.iexploit.org/index.php/javascript/level-5\";
} else
alert(\"Wrong password\");
}
//Coded by x3n0n --- iExploit Dev team --
//Greetz to iExploit staff & members
<html>
<head>
<title>test</title>
<script type=\"text/javascript\" src=\"Challenge_four.js\"></script>
</head>
<body>
<input type=\"button\" onclick=\"get_user()\" value=\"Login\"/>
</body>
</html>