Results 1 to 7 of 7

Thread: tag for showing viewer info? ie:IP,browser,OS,ISP???

  1. #1
    Join Date
    Feb 2005
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question tag for showing viewer info? ie:IP,browser,OS,ISP???

    I heard there was a tag called show globals, but im not sure anyone that can help me to find a tag to display the viewer's IP, OS, ISP, and Browser...i know i have seen this before so i know its out there...thanx

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    I think you want a server-side solution. Clientside, all you can use is the navigator object. In PHP, for example, you can use things like $_SERVER['HTTP_REMOTE_ADDR'] to get the IP address, $_SERVER['HTTP_REMOTE_HOST'] to get the reverse lookup of that IP address, from which you can usually determine the ISP, and $_SERVER['HTTP_USER_AGENT'] to get the user-agent string, which may contain information such as the OS, browser name and version, and rendering engine. For example, my user-agent string (running Firefox on Fedora Core 4 on an i686) is:
    Code:
    Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.7.12) Gecko/20050922 Fedora/1.0.7-1.1.fc4 Firefox/1.0.7
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    As Trey mentioned, you'll need a server side language such as PHP for this. For example, something like the below code:

    <!--#echo var="REMOTE_ADDR"-->

    when inserted in a PHP enabled page (ie: something.php) will display the IP address of the browsing visitor.

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    I beg to differ. ddadmin's code is not PHP but SSI (server-side includes), generally named with a .shtml extension. To use PHP, you could use something like
    PHP Code:
    <?php echo($_SERVER['HTTP_REMOTE_ADDR']); ?>
    This is fine for REMOTE_ADDR, but you would probably want to use a more complex script to parse the others in most cases.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  5. #5
    Join Date
    Feb 2005
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default ok...but

    ok i havent done anything with PHP yet so ill have to try it out
    thnx
    and your shure there is no CSS solution to this

    -thnx
    -ps im pretty new at webdesign i know HTML and have just started learning CSS

  6. #6
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    CSS? Why would CSS have anything to do with it? CSS is for changing the style and layout of the page. You're talking about dynamic content. There is no way to do this client-side, unless you use something like ActiveX or Java. Even then it would be complicated and unreliable. The best solution is just to use server-side scripting.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  7. #7
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Quote Originally Posted by Twey
    I beg to differ. ddadmin's code is not PHP but SSI
    Ops you're right, I wasn't thinking straight.

Bookmarks

Posting Permissions

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