PHP Curl with verification code simulation login problem

Source: Internet
Author: User
Learning PHP soon, want to log into our school's educational administration system to grasp the removal of information, but the verification code that is not know how to live
210.44.176.133/(0qus0s55gb1ojp45n2h0sr55)/default2.aspx
///
Also invited the Forum of the cattle people pointing


Reply to discussion (solution)

Verification code either human flesh or machine recognition, machine identification to be based on the characteristics of the verification code to do processing, not so simple. Human flesh. Make an input submission and bring a cookie.

There is a verification code to do the simulation login too troublesome, to identify the verification code. As long as the other side to change a complex, there is no way.

Verification code either human flesh or machine recognition, machine identification to be based on the characteristics of the verification code to do processing, not so simple. Human flesh. Make an input submission and bring a cookie.


I'm going to human flesh. Input, the verification code has been taken, and now returns an object moved to here at post.
Baidu said is caught in the redirect, do not understand love here to make confused, do not know how to deal with it?

There is a verification code to do the simulation login too troublesome, to identify the verification code. As long as the other side to change a complex, there is no way.


I'm going to human flesh. Input, the verification code has been taken, and now returns an object moved to here at post.
Baidu said is caught in the redirect, do not understand love here to make confused, do not know how to deal with it?

Curlopt_followlocation have this set to 1?

Curlopt_followlocation have this set to 1?

The set up is really gone,
Now that's bad Request (Invalid number), what's the problem?

The number you passed in is not legal, see if someone let you enter the number, you enter other content.

It's best to post your code analysis.

It's best to post your code analysis.


After analysis, the actual login address should be 210.44.176.133, and then redirected to such address 210.44.176.133/(0QUS0S55GB1OJP45N2H0SR55)/ Default2.aspx, the middle brackets are randomly different each time, now how should I get this redirect address?
This is my way of writing.
function Curl_get_url () {$cookie _file=tempnam ('./ck ', ' Cookie '); $ch = Curl_init ("http://210.44.176.133"); curl_ Setopt ($ch, Curlopt_ssl_verifyhost, 1); curl_setopt ($ch, Curlopt_ssl_verifypeer, false); curl_setopt ($ch, Curlopt_ Returntransfer, 1); curl_setopt ($ch, curlopt_followlocation,true); curl_setopt ($ch, Curlopt_cookiejar, $cookie _file) ; curl_setopt ($ch, curlopt_maxredirs); $data = Curl_exec ($ch);//Run Curlcurl_close ($ch); return $data;}

The number you passed in is not legal, see if someone let you enter the number, you enter other content.



After analysis, the actual login address should be 210.44.176.133, and then redirected to such address 210.44.176.133/(0QUS0S55GB1OJP45N2H0SR55)/ Default2.aspx, the middle brackets are randomly different each time, now how should I get this redirect address?
This is my way of writing.
function Curl_get_url () {$cookie _file=tempnam ('./ck ', ' Cookie '); $ch = Curl_init ("http://210.44.176.133"); curl_ Setopt ($ch, Curlopt_ssl_verifyhost, 1); curl_setopt ($ch, Curlopt_ssl_verifypeer, false); curl_setopt ($ch, Curlopt_ Returntransfer, 1); curl_setopt ($ch, curlopt_followlocation,true); curl_setopt ($ch, Curlopt_cookiejar, $cookie _file) ; curl_setopt ($ch, curlopt_maxredirs); $data = Curl_exec ($ch);//Run Curlcurl_close ($ch); return $data;}

Request url:http://210.44.176.133/
Request Method:get
Status code:302 Found
Request Headersview Source
accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-encoding:gzip,deflate,sdch
accept-language:zh-cn,zh;q=0.8
Cache-control:max-age=0
Connection:keep-alive
Cookie:ttklinkfirst=1; hm_lvt_f5127c6793d40d199f68042b8a63e725=1390729405,1390740179,1390790720,1390790808; hm_lpvt_f5127c6793d40d199f68042b8a63e725=1390791234
host:210.44.176.133
user-agent:mozilla/5.0 (Windows NT 6.2) applewebkit/537.36 (khtml, like Gecko) chrome/31.0.1650.57 safari/537.36

Response Headersview Source
Cache-control:private
Connection:close
content-length:158
content-type:text/html; charset=gb2312
Date:mon, 02:54:29 GMT
location:/(DI3BFGQ4ZQK5C23N2OFOVR45)/default2.aspx
server:microsoft-iis/6.0
x-aspnet-version:1.1.4322
X-powered-by:asp.net

In curl_setopt ($ch, Curlopt_cookiejar, $cookie _file); Front Plus
curl_setopt ($ch, Curlopt_cookiefile, $cookie _file);

You use the Get method, the general login should be the Post method

Your address is an intranet address and cannot be tested.
You can only start debugging yourself.

In curl_setopt ($ch, Curlopt_cookiejar, $cookie _file); Front Plus
curl_setopt ($ch, Curlopt_cookiefile, $cookie _file);

You use the Get method, the general login should be the Post method

Your address is an intranet address and cannot be tested.
You can only start debugging yourself.


This is not the post of the place, is the post of the access address, the post is not submitted by the cookie, the school is to record that random address to determine the user should be, now is to get that random address, this is your landing page, landing will jump
210.44.176.133--Jump--210.44.176.133/(0QUS0S55GB1OJP45N2H0SR55)/default2.aspx
, and then submit the form after the jump page, but don't know how to get this address alas ...

Extract the address with a regular

  • Related Article

    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.