Eugene Posted July 11, 2006 Share Posted July 11, 2006 I'm using a modified script posted on http://php.net[code=php:0]$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);curl_exec($ch);curl_close($ch);[/code]The forum uses IPB software. I also tried it with simple forum i made, and it doesnt work. Help with why please?http://us3.php.net/manual/en/ref.curl.php#57872 Quote Link to comment https://forums.phpfreaks.com/topic/14332-curl-problem/ Share on other sites More sharing options...
ShogunWarrior Posted July 11, 2006 Share Posted July 11, 2006 Should [b]auth_key[/b] and [b]post_key[/b] 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:[b]echo(curl_exec($ch));[/b] where you have [b]curl_exec($ch);[/b] Quote Link to comment https://forums.phpfreaks.com/topic/14332-curl-problem/#findComment-56481 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.