Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

can someone help me with the curl_init()

Options
  • 10-10-2008 5:04am
    #1
    Closed Accounts Posts: 1


    first of all i am new here and i just want to say wowowowowowowowow

    second heloooo

    now to what i want :)

    i want to log in a vbulletin forum using curl_init()
    this is the code that i have
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, "http://www.avsforum.com/avs-vb/");
    curl_setopt($ch, CURLOPT_REFERER, 'http://www.pornbb.org');

    curl_setopt($ch, CURLOPT_HEADER, 1);
    curl_setopt($ch, CURLOPT_NOBODY, 0);
    curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_COOKIEJAR, dirname(__FILE__) . "/cookies.txt");
    curl_setopt($ch, CURLOPT_COOKIEFILE, dirname(__FILE__) . "/cookies.txt");
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, "username=mgtm3&password=23wer2&autologin=1&action=login.php");
    curl_exec($ch);

    // use this to pull up the thread you want to grab content from
    curl_setopt($ch, CURLOPT_URL, "http://www.avsforum.com/avs-vb/");
    $result = curl_exec($ch);
    echo $result;
    but it is not working why?


Comments

  • Registered Users Posts: 21,611 ✭✭✭✭Sam Vimes


    what happens when you try it? On a lot of free hosting the curl functions are disabled

    why do you have curlopt_url and curl_exec twice?

    are you sure the url is right? To log in would you use the url www.avsforum.com/avs-vb/?username....

    btw, you left your username and password in that code


Advertisement