我需要通過CURL和PHP在vbulletin上發佈論壇帖子,似乎並不是一項艱鉅的工作,但它必須具有圖像,而且我可以上傳一張圖片,但是隻要我添加第二個圖像,它似乎只是重定向到論壇中的頂級主題,我試圖發佈到?vbulletin發佈CURL和PHP的帖子
繼承人我的代碼,它似乎發佈第二個圖像只是改變圖像的路徑..但它不工作?
$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);
}
我會很感激的任何建議...一定有什麼地方hidding,但我看不出它..
感謝, 小號
我想知道什麼是$ this-> scrape-> fetch doing – Vineet1982