Vbulletin login with Curl

Today I try with vbulletin login with curl. I have a trouble problem and can’t login because there is no vbulletin cookie for login. I found soultion from vbulletin forum. Here it’s my code

`$posturl=$blog_live_site.”forum/login.php?do=login”; $postdata=”do=login&url=%2Findex.php&vb_login_md5password=”.$forum_pwd.”&vb_login_username=”.$username.”&cookieuser=1”; $user_agent = “Mozilla/5.0 (compatible; MSIE 5.01; Windows NT 5.0)”;

$ch = curl_init();

curl_setopt($ch, CURLOPT_POST,1); curl_setopt($ch, CURLOPT_POSTFIELDS,$postdata); curl_setopt($ch, CURLOPT_URL,$posturl); curl_setopt ($ch, CURLOPT_COOKIEJAR, “mydomain.com”); curl_setopt($ch, CURLOPT_REFERER, “http://www.mydomain.com/login.php“); curl_setopt($ch, CURLOPT_USERAGENT, $user_agent); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); $result=curl_exec ($ch); curl_close ($ch);

`

 

You also need to change cookie name from vbulletin admin panel. In admin panel , VB Option > Cookies and Header Options > Cookie Domain Add your domain name without www in Custom Setting. Domain name should be same like CURLOPT_COOKIEJAR value.

comments powered byDisqus