Finding Clients I.P.

Discussion in 'PHP' started by saurabhk, Feb 1, 2006.

  1. #1
    Hi
    please tell me if there is any in built function in php which detects the ip of the users visiting my website?
    saurabh
     
    saurabhk, Feb 1, 2006 IP
  2. amitpatel_3001

    amitpatel_3001 Results Follow Patience

    Messages:
    14,074
    Likes Received:
    1,178
    Best Answers:
    0
    Trophy Points:
    430
    #2
    Why dont u use any external tracker like addfreestats?
    That gives you all the information of the visitor
     
    amitpatel_3001, Feb 1, 2006 IP
  3. dave487

    dave487 Peon

    Messages:
    701
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Try $IP = getenv("REMOTE_ADDR");

    or

    $IP = $HTTP_SERVER_VARS["HTTP_X_FORWARDED_FOR"];
    $proxy = $HTTP_SERVER_VARS["REMOTE_ADDR"];
    $host = @gethostbyaddr($HTTP_SERVER_VARS["HTTP_X_FORWARDED_FOR"]);
     
    dave487, Feb 1, 2006 IP
  4. saurabhk

    saurabhk Peon

    Messages:
    149
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thanx dude
     
    saurabhk, Feb 2, 2006 IP
  5. macklove74232

    macklove74232 Peon

    Messages:
    24
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    thnkx i was looking for it 2
     
    macklove74232, Jun 3, 2009 IP