$ch = curl_init();
curl_setopt($ch
curl_setopt($ch
curl_setopt($ch
curl_setopt($ch
$out = curl_exec($ch);
curl_close($ch);
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: "
echo "referer: "
From:http://tw.wingwit.com/Article/program/PHP/201311/21136.html