Get Visitor or User Ip Address With PHP

Discussion in 'PHP' started by Sub~ZeRo, May 10, 2014.

  1. #1
    The Global Function is $_SERVER['REMOTE_ADDR']
    in Example :-

    <?php
    echo $_SERVER['REMOTE_ADDR'];
    ?>
    it's very simple example & simple Global Function For Beginners .
     
    Sub~ZeRo, May 10, 2014 IP
  2. EricBruggema

    EricBruggema Well-Known Member

    Messages:
    1,740
    Likes Received:
    28
    Best Answers:
    13
    Trophy Points:
    175
    #2
    LOL are you making a tutorial here? that's i think not the right place! :)
     
    EricBruggema, May 11, 2014 IP
  3. themasterpeice

    themasterpeice Member

    Messages:
    22
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    25
    #3
    I thought you are asking any question :p
     
    themasterpeice, May 11, 2014 IP
  4. biren.24736

    biren.24736 Greenhorn

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #4
    this code is fine but that never show the exact ip of the system?would u explain it briefly ???/
     
    biren.24736, Jun 12, 2014 IP
  5. EricBruggema

    EricBruggema Well-Known Member

    Messages:
    1,740
    Likes Received:
    28
    Best Answers:
    13
    Trophy Points:
    175
  6. stephan2307

    stephan2307 Well-Known Member

    Messages:
    1,277
    Likes Received:
    33
    Best Answers:
    7
    Trophy Points:
    150
    #6
    You need to make sure your terminology is correct. This is not a Global Function! $_SERVER is a SUPERGLOBAL variable. This variable happens to be an array in this case.
     
    stephan2307, Jun 20, 2014 IP
  7. benaya

    benaya Well-Known Member

    Messages:
    97
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    131
    Digital Goods:
    1
    #7
    If you are using google analytics, you need think of it.
     
    benaya, Jun 24, 2014 IP
  8. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #8
    What are you even talking about?
     
    nico_swd, Jun 25, 2014 IP
  9. benaya

    benaya Well-Known Member

    Messages:
    97
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    131
    Digital Goods:
    1
    #9
    If you are storing $_SERVER["REMOTE_ADDR"] into database, you have to filter the google analytics ip address.
     
    benaya, Jun 25, 2014 IP