# Obtain the verification code # manually enter the verification code & lt ;! DOCTYPEhtml & gt; obtain the information verification code: vc simulated login verification code php
Get verification code
Header ('content-Type: image/png ');
$ Authcode_url = "http://jwxt1.cumt.edu.cn/CheckCode.aspx ";
$ CookieFile = "cookie. tmp ";
$ Ch = curl_init ($ authcode_url );
Curl_setopt ($ ch, CURLOPT_COOKIEJAR, $ cookieFile); // Save the returned cookie information to the file
Curl_exec ($ ch );
Curl_close ($ ch);?>
Manually enter the verification code
Obtain information
Verification code:
Simulated login
/**
- Created by PhpStorm.
- User: apple
- Date: 30, 15/9
- Time */
$ LoginParams ['_ viewstate'] = 'ddwyode2ntm0otg7oz6gizhuo9i4p23lszjjnryu9enq = ';
$ LoginParams ['_ VIEWSTATEGENERATOR'] = '000000 ';
$ LoginParams ['txtusername'] = 'student id ';
$ LoginParams ['textbox2 '] = 'password ';
$ LoginParams ['txtsecretcode'] = $ _ POST ['vcode'];
$ LoginParams ['lblanguage'] = '';
$ LoginParams ['radiobuttonlist1'] = iconv ('utf-8', 'gb2312', 'studeny ');
$ LoginParams ['button1'] = iconv ('utf-8', 'gb2312', 'login ');
$ Url = "http://jwxt1.cumt.edu.cn/default2.aspx ";
$ CookieFile = "cookie. tmp ";
$ Curl = curl_init ();
Curl_setopt ($ curl, CURLOPT_URL, $ url );
Curl_setopt ($ curl, CURLOPT_HEADER, 0 );
Curl_setopt ($ curl, CURLOPT_RETURNTRANSFER, 0 );
Curl_setopt ($ curl, CURLOPT_COOKIEFILE, $ cookieFile );
Curl_setopt ($ curl, CURLOPT_COOKIEJAR, $ cookieFile );
Curl_setopt ($ curl, CURLOPT_POST, 1); // post method submission
Curl_setopt ($ curl, CURLOPT_POSTFIELDS, http_build_query ($ loginParams ));
Curl_exec ($ curl );
Curl_close ($ curl );
?>
Request the verification code, manually enter the cookie with the final request verification code, and then post the data. the browser does not display the verification code or the password is incorrect, but why does the browser display the following: the main interface after login cannot be read:
But after reading the link here, it seems that the login is successful. could you please help me?