User Control Panel
Advertisements

HELP US, HELP YOU!

posting in phpBB -Boards

 
Post new topic   Reply to topic    Bot Depot Forum Index -> Code Help
View unanswered posts
Author Message
blablubb
Newbie
Newbie


Joined: 22 Aug 2008
Posts: 1


PostPosted: Fri Aug 22, 2008 6:49 pm    Post subject: posting in phpBB -Boards Reply with quote

Hi,

i have a small problem posting in phpBB-Boards.

Code:

// $loginid is the sid, $postid the id of the thread, the thread already exists

function post($loginid, $postid){
$postValues="subject=&message=Test&mode=reply&sid=".$loginid"&post=Submit";
$fp = fsockopen("www.xyz.com", 80, $errno, $errstr, 30);
if (!$fp) {
    echo "$errstr ($errno)<br />\n";
} else {
    $out = "POST /posting.php HTTP/1.1\r\n";
    $out .= "Host: www.xyz.com\r\n";
    $out .= "User-Agent: xyz\r\n";
   $out .= "Keep-Alive: 300\r\n";
$out .= "Connection: keep-alive\r\n";
    $out.= "Cookie: sid=".$loginid;
    $lenght = strlen( $postValues );
    $out .= "Content-Type: application/x-www-form-urlencoded\r\n";
    $out .= "Content-Length: $lenght\r\n";
    $out .= "Connection: Close\n\n";
    $out .= $postValues;
    $out .= "\r\n";
    fwrite($fp, $out);
    echo $out."<br><br><br>";
    while (!feof($fp)) {
        $buffer .=fgets($fp, 128);
    }
    fclose($fp);

}
}


so far connecting is not the problem, a similar login-function runs properly
however i think i overlooked some neccesary POST-variables
all phpBB answers is something like: "no posting-mode choosen"
however i clearly send a mode variable
Perhaps you can help. [although its php]
Back to top
Teario
Member
Member


Joined: 25 Jun 2004
Posts: 130
Location: Liverpool(home) or Derby(uni), UK
Reputation: 59.8
votes: 3

PostPosted: Sat Aug 23, 2008 8:26 am    Post subject: Reply with quote

It could be nothing but did you try using \r\n\r\n after connection: close instead of just \n\n, I cant tell you how much trouble ive had to do with that type of thing. How are you finding out the fields etc...? Have you tried using wireshark and making a reply in your browser so you can packet sniff the exchange?
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Bot Depot Forum Index -> Code Help All times are GMT
Page 1 of 1

 



Protected by phpBB Security phpBB-TweakS
phpBB Security Has Blocked 9 Exploit Attempts.
Antispam Captcha Mod by phpbb-security.com
Powered by phpBB © 2001, 2005 phpBB Group