我需要在论坛上发布什么 $_POST[] 内容?
我是论坛的管理员。 早些时候我们有 phpbb 2.0,我制作了一个可以向论坛写入内容的机器人。 现在,我们已将论坛升级到 phpbb 3.0,但我无法再让我的机器人向论坛写入内容。
我一直在寻找解决方案,但现在我没有主意了。 所以如果有人有建议那就太好了。
顺便说一句,我使用 CURL 和 php 来制作这个机器人。
机器人的使用: 用户登录外部网站报告他们在线踢的足球比赛的结果。 然后机器人会自动在论坛上发表帖子。
所以基本上我需要知道我需要发送什么 $_POST[] 。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我建议查看网站上“添加帖子”表单的源代码。 检查 HTML; 您需要模拟每个
input
或select
元素,因为这些是通过表单提交的 POST 值。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
orselect
element, as these are the POST values that are submitted via the form.或者使用一个好的 http 数据包分析器(例如 Windows 上的 Fiddler)并查看当您手动发布时浏览器发送的内容。
不过,我同意玩具城黑手党的观点,查看发送或接收页面的源代码应该很简单。
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.
如果您使用的是 Firefox,则可以使用 Firebug 来查看有哪些内容使用表单生成,以及实时http标头以查看实际发送回的内容。
HTTP 标头可能是最好的方法,因为它也包含 cookie 标头,并且您可能会发现 phpbb 3 在允许用户发帖之前检查用户会话。
如果您也熟悉 PHP,则只需查看源代码并查看它正在执行哪些验证(或使用调试器的步骤)。
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).
发现建议使用phpbb功能而不是直接编辑数据库。
此处的主题:http://www.phpbb.com phpbb.com/community/viewtopic.php?f=71&t=936535&p=5358845 显示了如何使其工作的一个很好的示例。
发帖到论坛的功能解释如下:wiki.phpbb.com/Submit_post
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
既然这是您的论坛,为什么不创建一个脚本来查询数据库并在需要发帖时执行适当的
INSERT
操作呢?我个人认为这比使用 HTTP 查询发帖更好...除非它真的不是你的论坛...
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...