Parse the PHP cross-site ticket collection implementation code. To put it bluntly, copy the code below: functioncurlrequest ($ url, $ postfield, $ referer, $ cookie) {www.jb51.net $ iprand (100,244 )... rand (100,244 ). let's talk about the code.
The code is as follows:
Function curlrequest ($ url, $ postfield, $ referer = '', $ cookie = ''){
// Http://www.jb51.net
$ Ip = rand (100,244). '.'. rand (100,244). '.'. rand (100,244). '. rand (100,244 );
$ Ch = curl_init ();
Curl_setopt ($ ch, CURLOPT_URL, $ url );
Curl_setopt ($ ch, CURLOPT_HEADER, 0 );
Curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, 1 );
Curl_setopt ($ ch, CURLOPT_POST, 1 );
Curl_setopt ($ ch, CURLOPT_POSTFIELDS, $ postfield );
Curl_setopt ($ ch, CURLOPT_COOKIE, $ cookie );
Curl_setopt ($ ch, CURLOPT_HTTPHEADER, array ('x-FORWARDED-FOR: '. $ ip, 'client-IP:'. $ ip); // Construct an IP address
Curl_setopt ($ ch, CURLOPT_REFERER, $ referer); // Construct a path
$ Data = curl_exec ($ ch); // run curl
Curl_close ($ ch );
Return $ data;
}
$ Url = 'http: // xxxxx/vote. php ';
$ Ref = 'http: // xxxxx/index. php ';
$ Cookies = ''; // Construct your cookies
$ Postfield = array (
& Apos; information _ id' = & apos; 201204211839164950 & apos;
);
$ Postfield = http_build_query ($ postfield );
$ Result = curlrequest ($ url, $ postfield, $ ref, $ cookies );
Echo $ result;
The response code is as follows: function curlrequest ($ url, $ postfield, $ referer = '', $ cookie ='') {// http://www.jb51.net $ ip = rand (100,244 ). '. '. rand (100,244 ). '...