PHP simulated post aspx page is unsuccessful

Source: Internet
Author: User
The following instance returns the 0| access limit! Please reload the page
Should put back -2| license plate number wrong


/************************************************************************
Name:post Test procedure vesion:1.0 date:2004-08-05
*************************************************************************/
$keyimg =$_post[' keyimg '];
if ($keyimg) {
$flag = 0;
The data to post
$ARGV = Array (
' Action ' = ' Illagel ',
' Back4 ' = ' 3248 ',
' Headno ' = ' yue ',
' No ' = ' LA9532 ',
' Type ' = ' 02 ',
' Validate ' = $keyimg
);
Constructing a string to post
foreach ($argv as $key = = $value) {
if ($flag!=0) {
$params. = "&";
$flag = 1;
}
$params. = $key. " =";
$params. = UrlEncode ($value);
$params. = $value;
$flag = 1;
}
Echo $params;
$length = strlen ($params);
Create a socket connection
$fp = Fsockopen ("www.gdhzcgs.com", $errno, $errstr, ten) or exit ($errstr. " ---> ". $errno);
Constructs the header of a POST request
$header = "Post/illegal.aspx http/1.1\r\n";
$header = "Post/ajax.aspx http/1.1\r\n";
$header. = "host:www.gdhzcgs.com\r\n";
$header. = "referer:www.gdhzcgs.com/illegal.aspx\r\n";
$header. = "content-type:application/x-www-form-urlencoded\r\n";
$header. = "Content-length:". $length. " \ r \ n ";
$header. = "connection:close\r\n\r\n";
Add a string for post
$header. = $params. " \ r \ n ";
Send data for Post
Fputs ($fp, $header);
$inheader = 1;
while (!feof ($fp)) {
$line = fgets ($fp, 1024); Removal of the header of the request package shows only the return data of the page
if ($inheader && ($line = = "\ n" | | $line = = "\ r \ n")) {
$inheader = 0;
}
if ($inheader = = 0) {
Echo $line;
}
}
Fclose ($FP);
}
else{
echo ' keyimg= empty ';
}
?>





<title>Online DMV</title>





Reply to discussion (solution)

Curl doesn't have to make wheels, and it hurts to watch.

Curl doesn't have to make wheels, and it hurts to watch.

Curl
Http://www.gdhzcgs.com/Ajax.aspx
also return
0| Access Restrictions! Please reload the page

Request Headers Value
(Request-line) Post/ajax.aspx http/1.1
X-requested-with XMLHttpRequest
Accept-language ZH-CN
Referer http://www.gdhzcgs.com/Illegal.aspx
Accept */*
Content-type application/x-www-form-urlencoded
Accept-encoding gzip, deflate
User-agent mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; trident/5.0)
Host www.gdhzcgs.com
Content-length 69
Connection keep-alive
Cache-control No-cache
Cookie asp.net_sessionid=rimtcb55pc2gcgurkaimgi45; cnzzdata3614737=cnzz_eid=42940778-1343020353-&ntime=1343020353&cnzz_a=0&retime=1343020354714& Sin=&ltime=1343020354714&rtime=0

There is a cookie.

Find a HttpWatch fully simulated access process: Novice easy to ignore AJAX access.
This also needs to simulate a lot of the session hidden by the Ajax "secret" generated, to dig it up.
More complex points, and sometimes to see its JS code, Wood has methods, followed by HttpWatch full simulation access it

I cross-domain access also encountered the same problem ah, dizzy, I would like to ask the landlord finally what method to solve, the same request?

  • 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.