Questions about phpcurl simulated login https://login.yahoo.co.jp

Source: Internet
Author: User
Phpcurl simulated login https://login.yahoo.co.jp problem code I basically wrote out, but the capture page is to let the input verification code is as follows: privatefunctionlogin () {& nbsp; $ is_login = 0; & nbsp; php curl simulated login https://login.yahoo.co.jp problems
I basically wrote the code, but the captured page allows you to enter the verification code.
The code is as follows:
Private function login (){
$ Is_login = 0;
$ Rurl = "http://www.yahoo.co.jp ";
// Obtain the random code
$ Ch = curl_init ();
Curl_setopt ($ ch, CURLOPT_URL, "https://login.yahoo.co.jp/config/login ");
Curl_setopt ($ ch, CURLOPT_COOKIEJAR, $ this-> cookie_jar );
Curl_setopt ($ ch, CURLOPT_HEADER, 1 );
Curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, true );
Curl_setopt ($ ch, CURLOPT_SSL_VERIFYPEER, false );
Curl_setopt ($ ch, CURLOPT_SSL_VERIFYHOST, false );
$ Tmp = curl_exec ($ ch );
// Curl_close ($ ch );
Preg_match ('/ /I ', $ tmp, $ mchallenge );
Preg_match ('/ /I ', $ tmp, $ mu );
Preg_match ('/ /Is ', $ tmp, $ malbatross );

$ Challenge = $ mchallenge [1];
$ U = $ mu [1];
$ Albatross = $ malbatross [1];
// Print_r ($ cookie_jar); exit;
// Print_r ($ arr); exit;
// $ Hash_passwd = md5 (md5 ($ this-> user_pwd). $ challenge );
// Step 1: initial login
// $ Ch = curl_init ();
Curl_setopt ($ ch, CURLOPT_URL, "https://login.yahoo.co.jp/config/login ");
Curl_setopt ($ ch, CURLOPT_POST, 1 );
Curl_setopt ($ ch, CURLOPT_POSTFIELDS ,". albatross = ". $ albatross. "&. ct = ". "&. tries = 1 &. src = &. md5 = &. hash &. js = &. last = & promo = &. intl = jp &. bypass = &. partner = &. u = ". $ u. "&. v = 0 &. challenge = ". $ challenge. "&. yplus = &. emailCode = & pkg = & stepid = &. ev = & hasMsgr = 0 &. chkP = Y &. done = ". $ rurl. "&. pd = &. protoctl = & login = ". $ this-> username. "& passwd = ". $ this-> password );//
Curl_setopt ($ ch, CURLOPT_COOKIEJAR, $ this-> cookie_jar );
Curl_setopt ($ ch, CURLOPT_HEADER, 1 );
Curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, true );
Curl_setopt ($ ch, CURLOPT_SSL_VERIFYPEER, false );
Curl_setopt ($ ch, CURLOPT_SSL_VERIFYHOST, false );
$ Str = curl_exec ($ ch );
Curl_close ($ ch );
Echo $ str; exit;
// Determine whether the logon is successful
If (strpos ($ str, "HTTP/1.1 302 Found ")! = False ){
$ Is_login = 1;
}
Return $ is_login;
}
Both the user name and password are available, but the verification code is entered after simulated logon, which is depressing,
The heroes of soso can help solve the problem,
The source code name = ". albatross" in the https://login.yahoo.co.jp/has something to do with the login, every time the page is refreshed, it will change, so I guess it is related,

------ Solution --------------------
It seems that it is not successful ~~
------ Solution --------------------
Unless someone has done something else, you may not be able to get the answer here.
------ Solution --------------------
Enter the verification code




No solution.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.