To "Brush ticket" friends provide a good solution for IP, check the next, curl is really tough can forge IP and source.
1.php 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′)); Constructing IP
curl_setopt ($ch, Curlopt_referer, "http://www.gosoa.com.cn/"); Construction route
curl_setopt ($ch, Curlopt_header, 1);
$out = curl_exec ($ch);
Curl_close ($ch);
The 2.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"];
Forge success, this is not!!
The small garden of the wind--more serious development of PHP platform
< p="">
http://www.bkjia.com/PHPjc/440359.html www.bkjia.com true http://www.bkjia.com/PHPjc/440359.html techarticle to the friend to brush the ticket to provide a good solution for IP, check the next, curl is really tough can forge IP and source. 1.php request 2.php. 1.php code: $ch = Curl_init (); Curl_seto ...