CURL Login on a Page

Discussion in 'PHP' started by aliks0905, Apr 3, 2009.

  1. #1
    I'm trying to login to Megaupload.com. They recently changed their page so the login form submits through javascript and I'm not sure how to circumnavigate that.

    Here's my code:
    
    $loginurl = 'http://www.megaupload.com/?c=login';
    $logincontent = array ();
    $logincontent['username'] 		= 'al_2323';
    $logincontent['password']		= 'mypassword';		
    $ch = curl_init ();
    curl_setopt($ch, CURLOPT_URL, $loginurl);
    curl_setopt ($ch, CURLOPT_POST, 1);
    curl_setopt ($ch, CURLOPT_POSTFIELDS, $logincontent);
    curl_setopt ($ch, CURLOPT_COOKIEJAR, 'cookiemu.txt');
    curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
    $store = curl_exec ($ch);
    
    Code (markup):
    Thanks.
     
    aliks0905, Apr 3, 2009 IP
  2. matthewrobertbell

    matthewrobertbell Peon

    Messages:
    781
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Use livehttpheaders for firefox to see what data is being passed when you login.
     
    matthewrobertbell, Apr 5, 2009 IP