Page 1 of 1

PHP AOL LOGIN

Posted: Mon Oct 24, 2005 7:47 am
by cyrenity
hi guys, i am trying to login to aol webmail but it's taking me again to login page, i am sending all necessory headers , here is my code, please help me. it has become challenge for me
PHP Code:

Code: Select all

<?php
        //dl('php_curl.dll');
        $curl = curl_init();
        $url_login_box = "https://my.screenname.aol.com/_cqr/login/login.psp?mcState=initialized&seamless=novl&sitedomain=sns.webmail.aol.com&lang=en&locale=us&authLev=2&siteState=ver%3a1%252c0%26ld%3awebmail.aol.com
"; 
      $user="username";
      $pass= "passsword here";
        curl_setopt($curl, CURLOPT_URL, $url_login_box);
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
        //curl_setopt($curl, CURLOPT_PROXY, '202.165.250.76:8080');
        curl_setopt($curl, CURLOPT_VERBOSE, 0);
        curl_setopt($curl, CURLOPT_COOKIEJAR, 'ck.txt');
        curl_setopt($curl, CURLOPT_HEADER,1);
        //curl_setopt($curl, CURLOPT_HTTPHEADER, $arr);
        curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);

        $data1 = curl_exec($curl);
        //curl_close();
        preg_match_all("|Set-Cookie:(.+?);|", $data1, $result);
        $ckies = trim($result[1][0]).'; '.trim($result[1][1]);
    //$ckies = trim(implode("; ", $result[1]));
    $post_fields = "sitedomain=sns.webmail.aol.com&siteId=&lang=en&locale=us&authLev=2&siteState=ver%253A1%25252c0%2526ld%253Awebmail.aol.com&isSiteStateEncoded=true&mcState=initialized&usrd=4468306&loginId=".$user."&password=".$pass."&rememberMe=off";
    echo $ckies.'<br>';
    
    $arr[] = "POST /_cqr/login/login.psp HTTP/1.1";
    $arr[] = "Host: my.screenname.aol.com";
    $arr[] = "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b5) Gecko/20051006 Firefox/1.4.1";
    $arr[] = "Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5";
    $arr[] = "Accept-Language: en-us,en;q=0.5";
    $arr[] = "Keep-Alive: 300";
    $arr[] = "Connection: keep-alive";
    $arr[] = "Referer: https://my.screenname.aol.com/_cqr/logi ... il.aol.com";
    $arr[] = "Cookie: " . $ckies ;
    $arr[] = "Content-Type: application/x-www-form-urlencoded";    
    $arr[] = "Content-Length: " . strlen($post_fields);
    $arr[] = $post_fields;
    print_r($arr);
        
    echo "<pre>".$data1."</pre>";
        echo "completed Transaction 1<br>";
        $url_login_post = "https://my.screenname.aol.com/_cqr/login/login.psp";
        curl_setopt($curl, CURLOPT_URL, $url_login_post);
        curl_setopt($curl, CURLOPT_HTTPHEADER, $arr);

    $data2 = curl_exec ($curl);
    echo $data2;

?>
Jcart | Removed your password for ya ;)

Posted: Tue Oct 25, 2005 5:18 am
by cyrenity
hello?

Posted: Tue Oct 25, 2005 8:48 am
by hawleyjr
Hey! Remove your password from the query string.