Jump to content

Is it possible to send a different IP address using CURL when you make requests to a server?


ShivaGupta

Recommended Posts

What exactly is the point? You would never receive the response.

the point is retrive visiter ip using this code. then   $user_ip =  IP address using CURL when you make requests to a server.........because server blocked my host   resion many request s frm my ip so my ip get blocked.sory for my bad english..

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();

No, it is not possible to do what you want. You can send the user's IP as additional data in the request, but you can't make it 'originate' from that IP. If your server is blocked, most likely you're doing something you are not supposed to be doing so naturally they are going to block you.

No, it is not possible to do what you want. You can send the user's IP as additional data in the request, but you can't make it 'originate' from that IP. If your server is blocked, most likely you're doing something you are not supposed to be doing so naturally they are going to block you.

so i am sad. is there any alternative way of spoofing your IP address using PHP?

so i am sad. is there any alternative way of spoofing your IP address using PHP?

Even if you could, as has been mentioned, you would not get the response so it wouldn't really do you any good.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.