来自VBulletin的cURL网络抓取

时间:2014-10-03 16:04:21

标签: php curl vbulletin

您需要一些帮助我是cURL的新手,我正在尝试从http://www.ugbettingforum.co.uk废弃数据, 所以我可以将论坛中的任何更改发送到我的电子邮箱。

但无法通过登录。论坛是VBulletin,我设法得到按摩“感谢登录用户名”,但重定向后,我没有进入。

这是我的代码:

function vBulletinLogin($user, $pass){
   $md5Pass = md5($pass);
   $data = "do=login&url=%2Findex.php&vb_login_md5password=$md5Pass&vb_login_username=$user&cookieuser=1";

   $ch = curl_init();

curl_setopt ($ch, CURLOPT_URL, "http://www.ugbettingforum.co.uk/login.php?do=login"); // replace ** with tt
curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.3; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0");
curl_setopt ($ch, CURLOPT_TIMEOUT, '10');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch,CURLOPT_POSTFIELDS,$data);
curl_setopt($ch, CURLOPT_COOKIEJAR, "/cookie.txt");
curl_setopt($ch, CURLOPT_COOKIEFILE, "/cookie.txt");
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
$store = curl_exec ($ch);
echo $store;
curl_close($ch);}

0 个答案:

没有答案
相关问题