vbulletin使用CURL和PHP发布帖子

vbulletin使用CURL和PHP发布帖子,php,vbulletin,Php,Vbulletin,我需要通过CURL和PHP在vbulletin上发布论坛帖子,这似乎不是一件困难的工作,但是它必须有图片,我可以上传一个图片,但一旦我添加第二个图片,它似乎就重定向到我试图发布到的论坛的顶部线程 这是我的代码,似乎发布第二张图片只是改变了图片的路径。。但它不起作用 $post = array( 'st' => '0', 'act' => 'Post', 's' => '',

我需要通过CURL和PHP在vbulletin上发布论坛帖子,这似乎不是一件困难的工作,但是它必须有图片,我可以上传一个图片,但一旦我添加第二个图片,它似乎就重定向到我试图发布到的论坛的顶部线程

这是我的代码,似乎发布第二张图片只是改变了图片的路径。。但它不起作用

$post = array(
                'st' => '0',
                'act' => 'Post',
                's' => '',
                'f' => '157',
                'auth_key' => $this->scrape->fetchBetween("<input type='hidden' name='auth_key' value='", "'",$this->scrape->result),
                'removeattachid' => '0',
                'MAX_FILE_SIZE' => '0',
                'CODE' => '01',
                'post_key' => $this->scrape->fetchBetween("<input type='hidden' name='post_key' value='", "'",$this->scrape->result),
                'TopicTitle' => $data['title'],
                'TopicDesc' => '',
                'tag' => $tag,
                'bbmode' => 'normal',
                'ffont' => '0',
                'fsize' => '0',
                'fcolor' => '0',
                'LIST' => 'LIST ',
                'helpbox' => 'Image (alt + g) [img]http://www.dom.com/img.gif[/img]',
                'tagcount' => '',
                'Post' => $description,
                'enableemo' => 'yes',
                'enablesig' => 'yes',
                'iconid' => '0',
                'FILE_UPLOAD' => "@".$data['img1'],
                'attachgo' => 'Add This Attachment'
        );
        $this->scrape->fetch('http://forum.lowyat.net/index.php?', $username, $post);
        if(!empty($data['img2'])) {
            $post = array(
                'st' => '0',
                'act' => 'Post',
                's' => '',
                'f' => '157',
                'auth_key' => $this->scrape->fetchBetween("<input type='hidden' name='auth_key' value='", "'",$this->scrape->result),
                'removeattachid' => '0',
                'MAX_FILE_SIZE' => '0',
                'CODE' => '01',
                'post_key' => $this->scrape->fetchBetween("<input type='hidden' name='post_key' value='", "'",$this->scrape->result),
                'TopicTitle' => $data['title'],
                'TopicDesc' => '',
                'tag' => $tag,
                'bbmode' => 'normal',
                'ffont' => '0',
                'fsize' => '0',
                'fcolor' => '0',
                'LIST' => 'LIST ',
                'helpbox' => 'Image (alt + g) [img]http://www.dom.com/img.gif[/img]',
                'tagcount' => '',
                'Post' => $description,
                'enableemo' => 'yes',
                'enablesig' => 'yes',
                'iconid' => '0',
                'FILE_UPLOAD' => "@".$data['img2'],
                'attachgo' => 'Add This Attachment');

            $this->scrape->fetch('http://forum.lowyat.net/index.php?', $username, $post);
            echo "<pre>";
            print_r($post);
            exit($this->scrape->result);

        }
$post=array(
'st'=>'0',
“act”=>“Post”,
's'=>',
‘f’=>‘157’,

“auth_key”=>$this->scrape->fetchBetween(“您没有在一篇文章中添加第二个图像:您正在使用两个图像进行两篇文章。当您通过欺骗文章参数进行此操作时,第一篇文章将被执行操作,而第二篇文章则不会,因为vBull具有防止两篇文章快速提交的保护功能。这些文章(几乎是)相同,所以第二个会被拒绝。您需要做的是检查POST结构是否在一次调用中包含第二个图像和欺骗,而不是在两次调用中

但是:作为一般指南,如果代码发生变化,这种方法将被视为“危险的”

您可能应该看看如何使用vBulletin提供的功能强大的API


和vBull一样,它有点复杂,但是有一个很好的论坛(如果你有许可证的话)可以帮助你。你会看到“POST”允许API中有一个数组。

我想知道$this->scrape->fetch在做什么