所以我正在尝试登录 Vbulletin 论坛,到目前为止一切都很好。它登录并且我看到它成功的消息,但随后尝试重定向到主 index.php 页面。基本上登录后我想导航到我的个人资料页面http://website.com/members/mr10.html
。这是我到目前为止所拥有的。
<?php
$xxx = curl_init();
curl_setopt_array($xxx, array(
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => 'http://website.com/login.php?do=login',
CURLOPT_USERAGENT => 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)',
CURLOPT_POST => 1,
CURLOPT_FOLLOWLOCATION => 1,
CURLOPT_COOKIE => 'cookies.txt',
CURLOPT_COOKIEJAR => 'cookies.txt',
CURLOPT_POSTFIELDS => array(
'vb_login_username' => 'mr10',
'vb_login_password' => '1234qwerA',
'submit' => '',
's' => '',
'do' => 'login',
'vb_login_md5password' => '',
'vb_login_md5password_utf' => ''
)
));
curl_exec($xxx);
curl_close($xxx);
$yyy = curl_init();
curl_setopt_array($yyy, array(
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => 'http://website.com/members/rastof.html',
CURLOPT_USERAGENT => 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)',
CURLOPT_FOLLOWLOCATION => 1,
CURLOPT_COOKIE => 'cookies.txt',
CURLOPT_COOKIEJAR => 'cookies.txt',
));
$resp = curl_exec($yyy);
curl_close($yyy);
echo $resp;
?>