$passwd="password";
if(xxxxx)
{
echo "<script language='JavaScript' type='text/javascript'>";
echo "var pwd=prompt('Введите пароль');";
echo "if (pwd && pwd==\"".$passwd."\"){";
echo " alert (\"Поздравляю вы прошли\");";
echo "}";
echo "</script>";
}