Show IP Address to users on Website

Discussion in 'HTML & Website Design' started by M_ac, Oct 2, 2009.

  1. #1
    I have a vBulletin Forum which I would like to display users IP addresses.

    I have created a php page with
    <?php echo $_SERVER['REMOTE_ADDR']; ?>
    Code (markup):
    When I access the php page directly is shows my IP address, which is what I want, but now I need to make it show on my site in the header, how can I make it show the IP in the header?

    Thanks
     
    M_ac, Oct 2, 2009 IP
  2. M_ac

    M_ac Peon

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Im still here :)
     
    M_ac, Oct 2, 2009 IP
  3. frantech

    frantech Greenhorn

    Messages:
    96
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    20
    #3
    Hey there,

    You should follow this a bit:

    vbulletin.com/docs/html/templates_externalfiles

    Pretty much, make a plugin that says

    $userip = $_SERVER['REMOTE_ADDR'];

    then you can just put $userip in the header template :)

    Thanks,

    Francisco
     
    frantech, Oct 2, 2009 IP
  4. anhbloginc

    anhbloginc Well-Known Member

    Messages:
    1,288
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    175
    #4
    Thanks for good way.
     
    anhbloginc, Oct 2, 2009 IP
  5. M_ac

    M_ac Peon

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    You are a legand, thanks so much for that, it worked like a charm.

    I wanted it because my forum members are mostly people working in IT and I thought it would be handy to have their IP address displayed. You can click on my signature link if you want to see how it turned out.
     
    M_ac, Oct 2, 2009 IP
  6. frantech

    frantech Greenhorn

    Messages:
    96
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    20
    #6
    Hey there,

    No problem, glad I could help :)

    Francisco
     
    frantech, Oct 2, 2009 IP