@
giuem 我试了 没用。
<?php
$lg='1';
$url='http://www.taolele.wang/a10/';
$length=array('5','6','7','8','9','10');
function generate_number($length) {
$chars='1234567890';
$password='';
for ($i=0;$i<$length;$i++) {
$password.=$chars[mt_rand(0,strlen($chars)-1)];
}
return $password;
}
for ($i=0;$i<$lg;$i++) {
$name=generate_number($length[array_rand($length)]);
$pass=generate_number($length[array_rand($length)]);
$option=array('http'=>array('method'=>"POST",'header'=>"content-type:application/x-www-form-urlencoded\r\nCookie:Mozilla/5.0 (iPhone; CPU iPhone OS 8_0_2 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12A366 Safari/600.1.4\r\n",'content'=>"name=$name&pass=$pass&submit="));
print_r(file_get_contents($url,false,stream_context_create($option)));
print_r($option);
}
?>
返回的是:
Access Denied!Array ( [http] => Array ( [method] => POST [header] => content-type:application/x-www-form-urlencoded Cookie:Mozilla/5.0 (iPhone; CPU iPhone OS 8_0_2 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12A366 Safari/600.1.4 [content] => name=3119867&pass=843901469&submit= ) )