Skip to main content
Stack Overflow
  1. About
  2. For Teams

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

How to get the client IP address in PHP

How can I get the client IP address using PHP?

I want to keep record of the user who logged into my website through his/her IP address.

Answer*

Draft saved
Draft discarded
Cancel
7
  • 2
    Actually i want to know the IP address of the Client who is using my website. Not the server IP addresss where my pages have uploaded or executing.. Please help me. Commented Jun 9, 2010 at 5:00
  • 53
    @Anup Prakash This is it – hence the "REMOTE" (from the perspective of the script). Commented Jun 9, 2010 at 5:01
  • 92
    Because you're on localhost ;) Commented Oct 8, 2013 at 8:33
  • 97
    @SiKni8 ::1 is the IPv6 equivalent of 127.0.0.1 Commented Dec 30, 2013 at 0:17
  • 17
    @CamiloMartin you just taught me something. cool! Commented Oct 17, 2015 at 3:25

lang-php

AltStyle によって変換されたページ (->オリジナル) /