Jump to content


cURL problem

  • Please log in to reply
1 reply to this topic

#1 Eugene

  • Members
  • PipPipPip
  • Advanced Member
  • 126 posts

Posted 11 July 2006 - 10:08 PM

I'm using a modified script posted on http://php.net

$topic_title = "title";
$topic_desc = "date";
$post = "post";
$question = "Question.";
$url = "http://";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "act=post&do=new_post&f=84&st=0&auth_key=66538cf7bb52399cba26f33e8984c06b&CODE=01&post_key=14355a276a3807b5c7232e0ab7aa3509&TopicTitle=$topic_title&TopicDesc=$topic_desc&Post=$post&dosubmit=Post New Topic&question_1=$question&choice_0=5&choice_1=4&choice_2=3&choice_3=2&choice_4=1&");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

The forum uses IPB software. I also tried it with simple forum i made, and it doesnt work. Help with why please?


#2 ShogunWarrior

  • Members
  • PipPipPip
  • Advanced Member
  • 528 posts
  • LocationIreland

Posted 11 July 2006 - 10:50 PM

Should auth_key and post_key be generated by the IPB forum?
Maybe they need to be unique.

Also, I think from the above code it will not output anything, CURLOPT_RETURNTRANSFER tells CURL to return the content into a variable so to output the result do this:
echo(curl_exec($ch)); where you have curl_exec($ch);
<a href="http://www.daviddora...nmedia.com/">My New Site/Blog</a> | <a href="http://www.daviddora...m/check/">Check your page for broken links/images/scripts</a>

Zend Certified Engineer
Follow me on Twitter: http://twitter.com/davidd

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users