
16.10.2009, 00:31
|
|
Участник форума
Регистрация: 12.03.2008
Сообщений: 159
Провел на форуме: 912928
Репутация:
137
|
|
PHP код:
<?php
$email="******";
$passwd="******";
$ch=curl_init();
$ckfile = "cookie.txt";
if (file_exists($ckfile) && is_writable($ckfile)){
echo "found cookie file!<br>";
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_COOKIEJAR, $ckfile);
curl_setopt($ch, CURLOPT_URL,"http://pda.vkontakte.ru/login?pda=index&acknowledge=0");
curl_setopt($ch, CURLOPT_HEADER,true);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "email=$email&pass=$passwd");
$buf=curl_exec($ch);
echo $buf;
curl_close($ch);
}
else {
echo "fail opening cookie file";
}
?>
Результат выводит, но куки в файл не записывает =( на самом файле права 0777. Почему?
|
|
|