ANTICHAT Forum
HOME FORUMS MEMBERS RECENT POSTS LOG IN  
Баннер 1   Баннер 2
НОВЫЕ ТОРГОВАЯ НОВОСТИ
loading...
Скрыть
Вернуться   ANTICHAT > ПРОГРАММИРОВАНИЕ > PHP
   
 
 
Опции темы Поиск в этой теме Опции просмотра

Помогите, php+curl+wordpress
  #1  
Старый 14.03.2010, 16:21
eniki
Новичок
Регистрация: 06.09.2009
Сообщений: 3
С нами: 8777913

Репутация: 1
По умолчанию Помогите, php+curl+wordpress

Пишу спамер по wp, в некоторые блоги норм отправляется, а вот в другие не хочет, не пойму почему, помогите пожалуйста разобраться, вот часть кода чисто для теста на блог в который не получается запостить
PHP код:
$ch = curl_init();
$url="http://sovch.chuvashia.com/?p=23218";

$html = ch_get(&$ch, $url);     

$postarray = array('author' => 'name', 
                               
'email' => 'mail@ya.ru', 
                                
'url' => 'google.ru',  
                                
'comment' => 'comment',  
                                
'submit' => 'Отправить',             
                                 
'comment_post_ID' => '23218',  
                                 
'dcaptcha_sess' => '1');

$html = ch_post(&$ch, "http://sovch.chuvashia.com/wp-comments-post.php", $url, $postarray);

curl_close($ch);

echo 
$html;

function 
ch_get($curl, $url)
{
    
curl_setopt($curl, CURLOPT_URL, $url);
    
curl_setopt($curl, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.0.8) Gecko/2009032609 Firefox/3.0.8");
    
curl_setopt($curl, CURLOPT_REFERER, $ref);
    
curl_setopt($curl,CURLOPT_RETURNTRANSFER, 1);
    
curl_setopt($curl,CURLOPT_FOLLOWLOCATION, 1);
    
curl_setopt($curl, CURLOPT_COOKIESESSION, TRUE);
    
curl_setopt($curl, CURLOPT_COOKIEFILE, getcwd()."/cookies.txt");
    return  
$html = curl_exec($curl);
 }




function 
ch_post($curl, $url, $ref, $postdata)
{
    
curl_setopt($curl, CURLOPT_URL, $url);
    
curl_setopt($curl, CURLOPT_REFERER, $ref);
    
curl_setopt($curl, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.0.8) Gecko/2009032609 Firefox/3.0.8");
    
curl_setopt($curl,CURLOPT_RETURNTRANSFER, 1);
    
curl_setopt($curl,CURLOPT_FOLLOWLOCATION, 1);
    
curl_setopt($curl, CURLOPT_COOKIESESSION, 1);
    
curl_setopt($curl, CURLOPT_COOKIEJAR, getcwd()."/cookies.txt");
    
curl_setopt($curl, CURLOPT_COOKIEFILE, getcwd()."/cookies.txt");
    
curl_setopt($curl, CURLOPT_POST, 1);
    
curl_setopt($curl,CURLOPT_POSTFIELDS, $postdata);
    return  
$html = curl_exec($curl);
} 

Последний раз редактировалось eniki; 14.03.2010 в 16:30..
 
Ответить с цитированием
 



Предыдущая тема Следующая тема
Похожие темы
Тема Автор Раздел Ответов Последнее сообщение
Помогите с регуляркой PHP Margin PHP 3 06.02.2010 01:36
Особенности миграции на PHP 5.3.x PandoraBox PHP 5 28.12.2009 16:20
Curl в Bambalam PHP EXE Compiler Mixon PHP 1 26.09.2009 12:55
Php галерея (помогите найти) a1nt PHP 9 09.03.2007 13:37
Помогите по php Скрипту XIII Разное - Покупка, продажа, обмен 2 05.12.2006 02:43



Здесь присутствуют: 1 (пользователей: 0 , гостей: 1)
 


Быстрый переход




ANTICHAT ™ © 2001- Antichat Kft.