您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

PHP用CURL伪造IP和来源_PHP教程

2024/3/30 11:43:19发布13次查看
来源ip,,,1.php 请求 2.php 。
1.php代码:
$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')); //构造ip
curl_setopt($ch, curlopt_referer, http://www.gosoa.com.cn/ ); //构造来路
curl_setopt($ch, curlopt_header, 1);
$out = curl_exec($ch);
curl_close($ch);
2.php代码如下:
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];
http://www.bkjia.com/phpjc/371880.htmlwww.bkjia.comtruehttp://www.bkjia.com/phpjc/371880.htmltecharticle来源ip,,,1.php 请求 2.php 。 1.php代码: $ch = curl_init(); curl_setopt($ch, curlopt_url, http://localhost/2.php); curl_setopt($ch, curlopt_httpheader, array('x-forwa...
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product