TAGS :Viewed: 9 - Published at: a few seconds ago

[ Fill a form with curl using previously saved client IP address ]

I'm developing a php application which register name, email and the ip address of the user who is filling the form.

When the form data is saved, i have to fill another form in another website with curl.

I need to use the client ip address or maybe a random ip address when i will fill the new form because the application where is the second form does not need to know my server ip address.

Is there any solutions to realize this curl request with different IP each times i will fill the form ?

Thanks in advance !

Answer 1

PHP runs at the server side. So you can not perform such request through PHP from client's end. However, you can use the following options to hide your server from the target.

Preferred method is using proxy:

curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1);
curl_setopt($ch, CURLOPT_PROXY, "");

Alternately you can try using IP binding. If your server has multiple IP addresses, you can uses them like below:

curl_setopt($ch, CURLOPT_INTERFACE, "");

If you have more time, you can read about the HTTP request header 'X-Forwarded-For‎'. This can be interesting for your solution too as well.