curl vbulletin login and post data

Discussion in 'PHP' started by dvdt01, Mar 25, 2011.

  1. #1
    i have a code login vbb by curl
    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();
    $reffer = 'http://aaa.com/f42/lalala_lblblb-91451.html';
    curl_setopt ($ch, CURLOPT_URL, "http://aaa.com/login.php?do=login"); // replace ** with tt
    curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
    curl_setopt ($ch, CURLOPT_TIMEOUT, '10');
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch,CURLOPT_POSTFIELDS,$data);
    curl_setopt($ch, CURLOPT_COOKIEJAR, "d:/tmp/codecall_$user.txt");
    curl_setopt($ch, CURLOPT_COOKIEFILE, "d:/tmp/codecall_$user.txt");
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
    curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_REFERER, $reffer);
    $store = curl_exec ($ch);
    print $store;

    }
    vBulletinLogin("aaaa","123456");


    i want after login then post comment is' abc................' at link 'http://aaa.com/f42/lalala_lblblb-91451.html'

    please help me support this

    thanks
     
    dvdt01, Mar 25, 2011 IP