Jump to content

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


Go to solution Solved by kicken,

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();
Edited by ShivaGupta
  • Solution

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?

Edited by ShivaGupta

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.