php - cURL send data after registration -
i can't message websites avito.ru problem if add curl_setopt($ch, curlopt_post,1); curl_setopt($ch, curlopt_postfields, $comment);
on page write write 404 if delete show page . me need send message. me please websites here 2oq.ru/avito/message error no code here
$urlout = 'https://m.avito.ru/saratov/vakansii/operator_frezerno-gravirovalnogo_stanka_s_chpu_890782585/write'; // Куда данные послать $urlto = 'https://www.avito.ru/profile/login?next=%2fprofile'; // Куда данные послать $login = 'tytr.trte@mail.ru'; // Логин $password = '1qazxsw2'; // Пароль $auth = 'login='.$login.'&password='.$password; // post данные $mes = '2oq.ru Сайт по поиску работы'; $comment = 'comment='.$mes; $ch = curl_init(); // Инициализация сеанса curl_setopt($ch, curlopt_url, $urlto); curl_setopt($ch, curlopt_useragent,'mozilla/5.0 (windows nt 6.1; wow64) applewebkit/537.36 (khtml, gecko) chrome/33.0.1750.154 safari/537.36'); curl_setopt($ch, curlopt_referer, 'http://www.avito.ru'); curl_setopt($ch, curlopt_post,1); curl_setopt($ch, curlopt_cookiejar,$_server['document_root'].'/cookiefile.txt'); curl_setopt($ch, curlopt_postfields, $auth); curl_setopt($ch, curlopt_returntransfer,1); curl_setopt($ch, curlopt_followlocation, true); // Говорим скрипту, чтобы он следовал за редиректами которые происходят во время авторизации curl_setopt($ch, curlopt_ssl_verifypeer, false); curl_setopt($ch, curlopt_ssl_verifyhost, false); curl_setopt ($ch, curlopt_httpheader, array('expect:')); // это необходимо, чтобы curl не высылал заголовок на ожидание $result = curl_exec($ch); curl_setopt($ch, curlopt_url, $urlout); curl_setopt($ch, curlopt_header, 0); // получать заголовки curl_setopt($ch, curlopt_post,1); curl_setopt($ch, curlopt_postfields, $comment); curl_setopt($ch, curlopt_connecttimeout,30); curl_setopt($ch, curlopt_useragent,'mozilla/5.0 (windows nt 6.1; wow64) applewebkit/537.36 (khtml, gecko) chrome/33.0.1750.154 safari/537.36'); curl_setopt($ch, curlopt_returntransfer,1); curl_setopt($ch, curlopt_cookiefile,$_server['document_root'].'/cookiefile.txt'); curl_setopt($ch, curlopt_followlocation, true); // Говорим скрипту, чтобы он следовал за редиректами которые происходят во время авторизации curl_setopt($ch, curlopt_ssl_verifypeer, false); curl_setopt($ch, curlopt_ssl_verifyhost, false); $result = curl_exec($ch); // Забираем страниц curl_close($ch); echo $result;
declare,
$ch = curl_init();
again before sending curl request.
Comments
Post a Comment