...

View Full Version : help



wicked
07-28-2002, 08:52 PM
i have a problem with this code i dont know whats wrong with it someone help me pls. is a password

<script language="JavaScript" type="text/javascript">

function checkpass()
{

var 2;

var 1="pass";

2=prompt('Your password here',' ');

if (1==2)
{

window.location="pr.php?pass="+1;
}
else
{
window.location="pr.php?pass=no";
}
}

</script>

x_goose_x
07-28-2002, 09:09 PM
You cannot assign a number a value:

var 1="pass";

you can use numbers within the name of variables as long as the first character of the variable name isn't numeric.

Try something like:

<script language="JavaScript" type="text/javascript">

function checkpass()
{

var b;

var a="pass";

b=prompt('Your password here',' ');

if (a==b)
{

window.location="pr.php?pass="+a;
}
else
{
window.location="pr.php?pass=no";
}
}

</script>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum