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, "102.43.85.90:8800");

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, "192.178.1.210");

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.