работа через прокси не идет,заменил post и функцию на ваши:
PHP код:
<?php
$bd = 'bd.txt';
$divider = ':';
$log = '1';
set_time_limit(0);
function post($url, $post, $cookieID,$socks=false,$v=5)
{
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_USERAGENT,
"Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.0.4) Gecko/2008102920 AdCentriaIM/1.7 Firefox/3.0.4");
if ($post <> null) {
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
}
if ($socks) {
curl_setopt($exec, CURLOPT_PROXYTYPE, ($v == 5 ? CURLPROXY_SOCKS5 : CURLPROXY_SOCKS4));
curl_setopt($exec, CURLOPT_PROXY, $socks);
}
curl_setopt($ch, CURLOPT_REFERER, "http://vkontakte.ru/");
curl_setopt($ch, CURLOPT_COOKIEJAR, getcwd() . '/' . $cookieID . '.c');
curl_setopt($ch, CURLOPT_COOKIEFILE, getcwd() . '/' . $cookieID . '.c');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
return $result;
}
function write($text)
{
$fh = fopen("log.txt", "a+");
$success - fwrite($fh, $text);
fclose($fh);
}
$bd = file($bd);
$ammount = count($bd);
for($i = 0; $i < $ammount; $i++)
{
$autorization = explode($divider,$bd[$i]);
$autorization[2] = trim($autorization[2]);
$result = post('http://vkontakte.ru/',null,$autorization[2]);
if (preg_match('#l">E(.*?)<#i',$result))
{
$result = post('http://vkontakte.ru/login.php','act=login&success_url=&fail_url=&try_to_login=1&to=&vk=&email='.$autorization[0].'&pass='.$autorization[1],$autorization[2],'94.41.3.250:1080',4);
$tempLog = ($log == '1') ? write("[".date("H:i")."] Авторизация ($autorization[2])\r\n") : null;
}
else
{
$tempLog = ($log == '1') ? write("[".date("H:i")."] Работа через cookie ($autorization[2])\r\n") : null;
}
}
?>
может где-то ошибка в скрипте?или надо чтото в конфигурацию php добавить?(в апач)
|