views:

364

answers:

5

Hi! I am admin on a forum. Earlier we had phpbb 2.0 and i made a bot that could write to the forum. Now, we have upgraded the forum to phpbb 3.0, but i can't get my bot to write to the forum anymore.

I have looked for a solution, but now i am out of ideas. So it would have been great if anyone have a suggestion.

i have btw used CURL and php to make this bot.

Usage of bot: Users log in on an external website to report results of footballmatches they have played online. The bot will then automatically write a post to the forum.

So basically i need to know what $_POST[] i need to send.

+4  A: 

I would advise looking at the source code of the 'add post' form on the site. Check the HTML; you will need to emulate each input or select element, as these are the POST values that are submitted via the form.

Philip Morton
+1  A: 

Or get hold of a good http packet analyser (e.g. Fiddler on Windows) and look at what your browser sends when you manually post.

I agree with Toytown Mafia, though, Looking at the sending or receiving page's source should be simple enough.

ZombieSheep
+1  A: 

If you're using Firefox, you can use Firebug to see what's being generated with the form, and also live http headers to see what actually gets sent back.

The HTTP headers would probably be the best way to go as it'll include cookie headers too, and you might find that phpbb 3 is checking for a user session before allowing a user to post.

If you know your way around PHP as well, you could just look through the source and see what validation it's performing (or use a step through debugger).

JamShady
A: 

Found that it is recommended to rather use the phpbb functions instead of directly editing the database. The topic here: http://www.phpbb.com/community/viewtopic.php?f=71&t=936535&p=5358845 shows a good example of how to get it working. The function for posting to a forum is explained here: wiki.phpbb.com/Submit_post

André
A: 

Since it's your forum, why not create a script that queries the database and does appropriate INSERT when it is required to post?

I personally think this would be a better idea than to post using HTTP queries... Unless it really isn't your forum...

Andrew Moore
it's my forum, and the reason why i wanted to do it that way, was because of the already existing system.