Antichat снова доступен.
Форум Antichat (Античат) возвращается и снова открыт для пользователей.
Здесь обсуждаются безопасность, программирование, технологии и многое другое.
Сообщество снова собирается вместе.
Новый адрес: forum.antichat.xyz
Помогите, php+curl+wordpress |

14.03.2010, 16:21
|
|
Новичок
Регистрация: 06.09.2009
Сообщений: 3
Провел на форуме: 86979
Репутация:
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, PERL, MySQL, JavaScript |
3 |
06.02.2010 01:36 |
|
Особенности миграции на PHP 5.3.x
|
PandoraBox |
PHP, PERL, MySQL, JavaScript |
5 |
28.12.2009 16:20 |
|
Curl в Bambalam PHP EXE Compiler
|
Mixon |
PHP, PERL, MySQL, JavaScript |
1 |
26.09.2009 12:55 |
|
Php галерея (помогите найти)
|
a1nt |
PHP, PERL, MySQL, JavaScript |
9 |
09.03.2007 13:37 |
|
Помогите по php Скрипту
|
XIII |
Разное - Покупка, продажа, обмен |
2 |
05.12.2006 02:43 |
|
Здесь присутствуют: 1 (пользователей: 0 , гостей: 1)
|
|
|
|