cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Re: auto login

From: haroon ahmad <haroon_at_fastcreators.com>
Date: Wed, 23 Apr 2008 12:26:34 +0500

Every service has different method to get you logged into their system. You
need to do http sniffing using livehttpheader kind of thing and track the
flow of the target services. then write your code to follow that process and
post the required variables.
You cannot use one method for all services.

Haroon Ahmad
Sr. Web Developer
www.fastcreators.com
2008/4/23 Rashmi Bhargav <rashmi.bhargav.86_at_gmail.com>:

> hi,
> I have been trying auto logins for gmail,yahoo,rediff,myspace etc.. my
> gmail code is as follows:
>
> $username=urlencode('emailaddr');
> $password="password";
> $gacookie="./.gmcookie";
> //&service=blogger
>
> $postdata="Email=$username&Passwd=$password
> &GA3T=5AS_gBsvDHI&nui=15&fpui=3&"."&ifr=true&rm=hide&itmpl=true&hl=en_US&alwf=true&continue=
> http://www.google.com/mail";
> $ch = curl_init();
> curl_setopt ($ch, CURLOPT_URL,"
> https://www.google.com/accounts/ServiceLoginBoxAuth");
> curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
> curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT
> 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6");
> curl_setopt ($ch, CURLOPT_TIMEOUT, 60);
> curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
> curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
> curl_setopt ($ch, CURLOPT_COOKIEJAR, $gacookie);
> curl_setopt ($ch, CURLOPT_COOKIEFILE, $gacookie);
> curl_setopt ($ch, CURLOPT_REFERER, '
> https://www.google.com/accounts/ServiceLogin?service=mail&passive=true&rm=false&continue=https%3A%2F%2Fmail.google.com%2Fmail%2F%3Fnsr%3D1%26ui%3Dhtml%26zy%3Dl&ltmpl=default&ltmplcache=2');
> curl_setopt ($ch, CURLOPT_POSTFIELDS, $postdata);
> curl_setopt ($ch, CURLOPT_POST, 1);
> $result = curl_exec ($ch);
> curl_close($ch);
> echo $result;
> unlink($gacookie);
> exit;
>
> the program works perfectly fine for all google accounts! now the problem
> is with yahoo..... i have been trying different urls for CURLOPT_URL and
> CURLOPT_REFERER. but all the tries ultimately lead to yahoo homepage not the
> login page. Can anyone please suggest me what to do and where im going
> wrong?
>
> thanks in advance,
> rashmi.
>
>
> _______________________________________________
> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
>
>

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2008-04-23