Results 1 to 7 of 7
  1. #1
    Join Date
    Jan 2006
    Posts
    2,593
    Tokens
    0

    Latest Awards:

    Default Displaying certain things in PHP

    I need to display:

    Peoples IP
    Peoples Browser

    Anybody know the PHP code for it?

  2. #2
    Join Date
    May 2005
    Location
    England
    Posts
    8,662
    Tokens
    0

    Latest Awards:

    Default

    HTML Code:
     <?php echo $_SERVER["REMOTE_ADDR"]; ?>
    Is the IP =]

  3. #3
    Join Date
    Nov 2005
    Posts
    807
    Tokens
    1,335

    Latest Awards:

    Default

    and the browser is:
    PHP Code:
    <?php echo $_SERVER['HTTP_USER_AGENT']; ?>
    so together they would be..
    PHP Code:
    <?php
    echo "IP: ".$_SERVER['REMOTE_ADDR']."<br />
    Browser: "
    .$_SERVER['HTTP_USER_AGENT']."";
    ?>
    Last edited by Splinter; 02-04-2006 at 06:04 PM.

  4. #4
    Join Date
    Aug 2004
    Location
    UK
    Posts
    11,283
    Tokens
    2,031

    Latest Awards:

    Default

    http://thybag.co.uk/index.php?p=Tutorials&ind=25
    Has all that and more

    althogh the bits u want are
    <?php echo $_SERVER['REMOTE_ADDR']; ?>
    IP
    and
    <?php echo get_browser('browser'); ?>
    For browser name (without the exstra crap)
    (phramiter name from memoery so may be wrong as php manual wont load

  5. #5
    Join Date
    Nov 2005
    Posts
    807
    Tokens
    1,335

    Latest Awards:

    Default

    I forgot the other browser code it could also be done in basic javascript...

  6. #6
    Join Date
    Jan 2006
    Posts
    2,593
    Tokens
    0

    Latest Awards:

    Default

    Thanking you all and rep when I can

  7. #7
    Join Date
    Feb 2006
    Location
    Scotland
    Posts
    2,087
    Tokens
    138

    Latest Awards:

    Default

    Yep, I needed this as well so thanks very much!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •