$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_PROXY, '41.242.90.3');
curl_setopt($ch, CURLOPT_PROXYPORT, '80');
$page = curl_exec($ch);
curl_close($ch);
return $page;
function getUserIP()
{
$client = @$_SERVER['HTTP_CLIENT_IP'];
$forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];
$remote = $_SERVER['REMOTE_ADDR'];
if(filter_var($client, FILTER_VALIDATE_IP))
$ip = $client;
elseif(filter_var($forward, FILTER_VALIDATE_IP))
$ip = $forward;
else
$ip = $remote;
return $ip;
}
$user_ip = getUserIP();
echo $user_ip;