Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Aug 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    auto submitting to a form using CURL

    Hi,
    I am using CURL to auto submit to a form using POST.
    I need to submit though using the user's ip address and not the
    server's ip address. Is there a way that I can pass through the user's ip address so it will look like they submitted the form?

    Thanks a lot,

    Leora

  • #2
    Regular Coder mic2100's Avatar
    Join Date
    Feb 2006
    Location
    Scunthorpe
    Posts
    562
    Thanks
    15
    Thanked 28 Times in 27 Posts
    hi,

    you will need to use
    PHP Code:
    echo $_SERVER['REMOTE_ADDR']; //this will get the remote address i.e. users ip 
    hopefully this will work for you.

  • #3
    New to the CF scene
    Join Date
    Aug 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi, thanks for your response,

    My question though has to do with how do I pass the user ip address to curl. I know that I can get it the user ip but how to pass it on is my question.

    Thanks,
    Leora

  • #4
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,066
    Thanks
    2
    Thanked 319 Times in 311 Posts
    The IP address that the receiving server sees, comes from the TCP/IP data packet. There is basically a from IP:PORT address and a to IP:PORT address. The TCP/IP packet is produced by the underlying layers of the TCP/IP protocol. You cannot set the IP address in the packet for a couple of reasons - you don't have access to it and the responses sent back by the receiving server would not come back to you.

    You also cannot "temporarily" change your IP address, because you would no longer be on your network and you could not communicate at all with your upstream router. If you happened to change your IP address and are still in your network, routers/TCP/IP protocol detects duplicates and would not allow it.

    Short answer - you can hide a true IP address by using a proxy, but you cannot use someone else's IP address.

    If you describe what it is you are trying to accomplish (as long as it is not setting up a phishing site or trying to break into someones account) we can probably point you in the right direction to find a way of doing it.
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •