У курла есть много вариантов использования )

<?php
$postfields = array();
$postfields["action"] = "submit";
$postfields["author"] = "Spammer";
$postfields["email"] = "spammer@spam.com";
$postfields["url"] = "http://www.iamaspammer.com/";
$postfields["comment"] = "I am a stupid spammer.";
$postfields["comment_post_ID"] = "123";
$postfields["_wp_unfiltered_html_comment"] = "0d870b294b";
//Url of the form submission
$url = "http://www.ablogthatdoesntexist.com/blog/suggerer_site.php
?action=meta_pass&id_cat=0";
$useragent = "Mozilla/5.0";
$referer = $url;

//Initialize CURL session
$ch = curl_init($url);
//CURL options
curl_setopt($ch, CURLOPT_POST, 1);
//We post $postfields data
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
//We define an useragent (Mozilla/5.0)
curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
//We define a refferer ($url)
curl_setopt($ch, CURLOPT_REFERER, $referer);
//We get the result page in a string
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
//We exits CURL
$result = curl_exec($ch);
curl_close($ch);

//Finally, we display the result
echo $result;
?>

Еще несколько ссылочек.

4 responses


Do you want to comment?

Comments RSS and TrackBack Identifier URI ?

Ну и зачем спамить ВордПресс?)) Хотя по теме — весчь хорошая, затестить стоит. Отпишусь по результатам.

Июль 7, 2009 3:43 пп

Я как бы и не призываю спамить вп ))

Июль 7, 2009 4:26 пп

А как консольным курлом такое реализовать -т.е. в скрипте шелла?

Февраль 20, 2010 11:12 дп

Джан, curl -T тут поля. Как-то так, надо ман почитать.

Февраль 20, 2010 11:38 дп

Comment now!
















Trackbacks

1