imperium2335 Posted October 17, 2009 Share Posted October 17, 2009 Hi, I have made the following script to post a comment to a wordpress blog, but it is not posting the comment nor echoing any result: $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "wp-comments-post.php"); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, "author=Phil&[email protected]&url=popopop&comment=this is phillip"); curl_setopt ($ch, CURLOPT_COOKIEJAR, $cookie); curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt ($ch, CURLOPT_REFERER, $currenturl); $z = rand(0, 4) ; curl_setopt($ch, CURLOPT_USERAGENT, $agents[$z]); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1) ; curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1) ; $result = curl_exec ($ch); curl_close ($ch); echo $result; Any ideas why it wont work? Thanks in advance! Link to comment https://forums.phpfreaks.com/topic/177999-php-curl-post/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.