0
使用此代码创建一个文件index.php,并请求此页面client.php,目的是显示将访问该页面的用户的IP地址。每当somone请求通过index.php它显示服务器ip或当有人直接访问client.php它将显示用户或客户端ip。这是可能通过用户IP做出请求吗?cURL通过客户端或用户IP的请求
$url = 'http://www.bomberfeeds.com/demo/client.php';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$data = curl_exec($ch);
curl_close($ch);
echo $data;
此工作为相同的域,但如果需要在跨域? –