How can I get the IP address of someone submitting a form?

Discussion in 'PHP' started by explorer, Jan 23, 2006.

  1. #1
    I have a php form that people sometimes fill in.

    The output from the form comes to me as an email.

    Is there a simple way I could have the IP of the person submitting the form recorded and included in the email? (The email comes from my webshost server and so its header contains the server IP rather the IP of the person submitting the form).

    Thanks :)
     
    explorer, Jan 23, 2006 IP
  2. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #2
    Add this variable to your email:

    $_SERVER['REMOTE_ADDR']
     
    digitalpoint, Jan 23, 2006 IP
    explorer likes this.
  3. explorer

    explorer Well-Known Member

    Messages:
    463
    Likes Received:
    40
    Best Answers:
    0
    Trophy Points:
    110
    #3
    Thanks Shawn, got it working now. :)
     
    explorer, Jan 23, 2006 IP