以下代码无法按我的预期工作......
curl_setopt($ch, CURLOPT_POSTFIELDS, "password="+$alphas[$x]+"&submit=yes");
通过将字母放入字符串中, $alphas[$x] 部分似乎不起作用。下面几行我回显 $alphas[$x] 并且效果很好。
例如,如果我将第一行代码更改为...
curl_setopt($ch, CURLOPT_POSTFIELDS, "password=j&submit=yes");
它可以按预期完美运行,因此我认为 $alpahs[$x] 没有像应有的那样将字母放入字符串中。
$content = "7";
$x = 0;
$alphas = array_merge(range("A", "Z"), range("a", "z"));
while($x < 52) {
print_r($alphas[$x]);
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_URL, "/Demo/form.php");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "password="+$alphas[$x]+"&submit=yes");
$content=curl_exec($ch);
echo $content;
echo "Pass: ";
echo $alphas[$x];
echo "<br>";
$x++;
}