Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cURL question

Status
Not open for further replies.

miraclemaker

Programmer
Oct 16, 2002
127
GB
Is there any way to set the IP address of where a POST is coming from using cURL? I suspect the answer is no, but I thought I'd better ask in case anyone knows better.
 
"set the IP address of where a POST is coming from"?

I'm sorry, but your question doesn't make any sense to me. How can you set the IP address of an input to a system which is basically client-driven?

You can get the IP address of a connection -- it'll be in $_SERVER['REMOTE_ADDR'] ( Want the best answers? Ask the best questions: TANSTAAFL!
 
Of course, the IP wouldn't be correct, but I wanted to set it in the same way you can set the referer using CURLOPT_REFERER
 
Simulate a POST to a page where the post must come from a certain IP.
 
I'm not in control of the page I am posting to, so setting the value of REMOTE_ADDR wouldn't have any effect on the remote page would it?
 
So what you're trying to do is spoof your IP?... you made it sound like you were communicating between two of your pages and wanted the IP to be read as a particular value... but you actually want to just output a fake IP, right? I'm not sure CURL is the tool you're looking for... for that matter, I'm not sure this is something you can do within your program, but rather may need to be setup on your computer before you run your script... but I'm not so good at spoofing IP's so I may be way off.

-Rob

 
Yes that's right, sorry if I wasn't clear. Thanks for the advice.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top