Ec (2); Check that CURL is really powerful and can forge IP addresses and sources. For more information about implementation, see. 1. php tutorial request 2.php. 1. php code: $ chcurl_init (); curl_setopt ($ ch, CURLOPT_URL, & quot; localhost2.php & quot;); curl_setopt ($ ch, CURLOPT_HTTPHE script ec (2 ); script
After checking that CURL is really powerful, it can forge IP addresses and sources. For more information about implementation, see.
1. php tutorial request 2.php.
1. php code:
$ Ch = curl_init ();
Curl_setopt ($ ch, CURLOPT_URL, "http: // localhost/2.php ");
Curl_setopt ($ ch, CURLOPT_HTTPHEADER, array ('x-FORWARDED-FOR: 8.8.8.8 ', 'client-IP: 8.8.8.8'); // construct an IP address
Curl_setopt ($ ch, CURLOPT_REFERER, "http://www.111cn.net/"); // construct a path
Curl_setopt ($ ch, CURLOPT_HEADER, 1 );
$ Out = curl_exec ($ ch );
Curl_close ($ ch );
2. the php code is as follows:
Function getClientIp (){
If (! Empty ($ _ SERVER ["HTTP_CLIENT_IP"])
$ Ip = $ _ SERVER ["HTTP_CLIENT_IP"];
Else if (! Empty ($ _ SERVER ["HTTP_X_FORWARDED_FOR"])
$ Ip = $ _ SERVER ["HTTP_X_FORWARDED_FOR"];
Else if (! Empty ($ _ SERVER ["REMOTE_ADDR"])
$ Ip = $ _ SERVER ["REMOTE_ADDR"];
Else
$ Ip = "err ";
Return $ ip;
}
Echo "IP:". getClientIp ()."";
Echo "referer:". $ _ SERVER ["HTTP_REFERER"];
Forged successfully. Is this a good IP address change solution for the "Ticket scalping" friends !!
Haha