Rapidshare login with curl

Discussion in 'PHP' started by Ultimate_coder, Sep 12, 2009.

  1. #1
    <?php
    $username=$_REQUEST['user'];
    $pass=$_REQUEST['pass'];
    $arr=urlencode("login=ancybercool1993&password=something");
    
    $ch=curl_init();
    curl_setopt($ch, CURLOPT_URL,"https://ssl.rapidshare.com/cgi-bin/premiumzone.cgi");
    curl_setopt($ch,CURLOPT_FOLLOWLOCATION,1);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS,$arr);
    curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
    curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,false);
    //curl_setopt($ch,CURLOPT_SSL_VERIFYHOST,0);
    curl_setopt($ch, CURLOPT_HEADER,0);
    $result=curl_exec($ch);
    if (curl_error($ch))
            printf("Error %s: %s", curl_errno($ch), curl_error($ch));
    curl_close($ch);
    echo $result;
    ?>
    
    Code (markup):
    what is wrong in this code why dosent it work
     
    Ultimate_coder, Sep 12, 2009 IP
  2. R0CKABILLY

    R0CKABILLY Peon

    Messages:
    19
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    u only get the page, and u only echo it..

    u must do a parsing so u can get information u want.
     
    R0CKABILLY, Sep 13, 2009 IP
  3. ThePHPMaster

    ThePHPMaster Well-Known Member

    Messages:
    737
    Likes Received:
    52
    Best Answers:
    33
    Trophy Points:
    150
    #3
    You need to remove the urlencode, you are using POST so that just confuses the server.
     
    ThePHPMaster, Sep 13, 2009 IP
  4. Ultimate_coder

    Ultimate_coder Peon

    Messages:
    43
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thank you dude for explaining the bug
     
    Ultimate_coder, Sep 14, 2009 IP