Verification code-use php to simulate login to the founder Educational Administration System

Source: Internet
Author: User
# 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?

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.