Jump to content

Post on phpbb3 forum using curl?


siddscool19

Recommended Posts

Hey people I want to post on my forum using phpbb3 script?

Is there any such script?

And also I have created the codings for posting and its working but the problem is that I can't send large data using it only like 5-6 lines I mean the phpbb3 forum is accepting only 5-6 lines:

<?php
$content=$_POST["content"];
echo $content;
$url = "http://localhost/phpbb3/ucp.php?mode=login";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_POST, 4);
curl_setopt($ch, CURLOPT_POSTFIELDS,"username=username&password=pass&redirect=&login=Login");
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_FOLLOWLOCATION,1);
curl_setopt($ch,CURLOPT_COOKIEJAR,"cookie.txt");
$result= curl_exec ($ch);
curl_close ($ch);
$data="hiiiiiiii";
$valuesubmit=array(
"icon"=>0,
"subject"=>"hiii",
"message"=>$data,
"lastclick"=>1224168250,
"post"=>"Submit",
"form_token"=>"cc7ee8be585ac8a58c1dc356c56d36ac623dd717",
"creation_time"=>"1224168251"
);
$ch2 = curl_init();
    curl_setopt($ch2,CURLOPT_URL,"http://localhost/phpbb3/posting.php?mode=post&f=2");
curl_setopt($ch2,CURLOPT_REFERER, "http://localhost/phpbb3/posting.php?mode=post&f=2");
curl_setopt($ch2, CURLOPT_POST, 4);
    curl_setopt($ch2, CURLOPT_POSTFIELDS,$valuesubmit);
    curl_setopt($ch2,CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch2,CURLOPT_CONNECTTIMEOUT,"120");
curl_setopt ($ch2, CURLOPT_HEADER, false );
curl_setopt($ch2,CURLOPT_COOKIEFILE,"cookie.txt");
$souvik123 = curl_exec($ch2);
$error=curl_error($ch2);
    curl_close($ch2);
echo $error;
echo $souvik123;
?>

Link to comment
https://forums.phpfreaks.com/topic/128718-post-on-phpbb3-forum-using-curl/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.