In PHP, the CURL technology simulates login and captures website information, and queries the website information with the scores of the WeChat public platform.

Source: Internet
Author: User

With the popularity, the public platform has become the next goal of many developers. The author is not so attractive to such new things. However, a friend recently helped develop a score query function on the public platform. So I studied it in my spare time.

The main implementation step is to simulate login to the target website through the php curl technology, obtain the user's score information through the login user, and use regular expressions to capture and store the data, use HTML technology to retypeset data.

The function of the public platform is to query scores for the purpose of browsing. The overall technical implementation lies in the php curl technology. Next, I found a file to obtain the score. The Code is as follows.

  

Please log on to Password


Qing. php

<? = ('./temp','cookie' = 'http://218.61.108.163/ACTIONQUERYSTUDENTSCORE.APPPROCESS' = 'WebUserNO=stuid&Password=passwd&Agnomen=code&applicant=ACTIONQUERYGRADUATESCHOOLREPORTBYSELF' = curl_init(, CURLOPT_HEADER, 0, CURLOPT_RETURNTRANSFER, 1, CURLOPT_POST, 1, CURLOPT_COOKIEJAR, , CURLOPT_POSTFIELDS, ='http://218.61.108.163/ACTIONQUERYGRADUATESCHOOLREPORTBYSELF.APPPROCESS' = curl_init(, CURLOPT_HEADER, 0, CURLOPT_RETURNTRANSFER, 0, CURLOPT_COOKIEFILE,  = curl_exec(    ="|(<=<td>).*(?=</td>)|"(,, = [0 = [1 = [1   ?>


Page for obtaining scores

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.