Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. How to access the IP Address of the client machine using Java Script or VBScript

How to access the IP Address of the client machine using Java Script or VBScript

Scheduled Pinned Locked Moved Web Development
javajavascripttoolshelptutorial
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    Hi Friends I am building an intranet site and want to access the IP Address or the domainname/ computer name of the client machine using javascript or vbscript. so if any one could help me i will be thankful.

    C 1 Reply Last reply
    0
    • L Lost User

      Hi Friends I am building an intranet site and want to access the IP Address or the domainname/ computer name of the client machine using javascript or vbscript. so if any one could help me i will be thankful.

      C Offline
      C Offline
      calebcohoon
      wrote on last edited by
      #2

      Here's some script that should work :) ////////////////////////////////// //// Note ////////////////////////////////// <!-- For the NS version below, the end user must --> <!-- have java enabled in there browser --> ////////////////////////////////// <!-- Netscape Version --> if (navigator.appName=='Netscape' && navigator.javaEnabled()) { hn = java.net.InetAddress.getLocalHost().getHostName(); ha = java.net.InetAddress.getLocalHost().getHostAddress(); document.write('HostName: '+ hn + '<br>' + 'HostAddress: '+ ha ); } ////////////////////////////////// //// Note ////////////////////////////////// <!-- For the IE version below, it must be run on --> <!-- on a web server spporting ISS --> ////////////////////////////////// <!-- IE Version --> if (navigator.appName=='Microsoft Internet Explorer') { var ip = "<!--#echo var=\"REMOTE_ADDR\"-->"; document.write(ip) } Hope that helps. I tryed documenting it a little bit for ya, so beer with me :-D Later, Caleb

      C 1 Reply Last reply
      0
      • C calebcohoon

        Here's some script that should work :) ////////////////////////////////// //// Note ////////////////////////////////// <!-- For the NS version below, the end user must --> <!-- have java enabled in there browser --> ////////////////////////////////// <!-- Netscape Version --> if (navigator.appName=='Netscape' && navigator.javaEnabled()) { hn = java.net.InetAddress.getLocalHost().getHostName(); ha = java.net.InetAddress.getLocalHost().getHostAddress(); document.write('HostName: '+ hn + '<br>' + 'HostAddress: '+ ha ); } ////////////////////////////////// //// Note ////////////////////////////////// <!-- For the IE version below, it must be run on --> <!-- on a web server spporting ISS --> ////////////////////////////////// <!-- IE Version --> if (navigator.appName=='Microsoft Internet Explorer') { var ip = "<!--#echo var=\"REMOTE_ADDR\"-->"; document.write(ip) } Hope that helps. I tryed documenting it a little bit for ya, so beer with me :-D Later, Caleb

        C Offline
        C Offline
        calebcohoon
        wrote on last edited by
        #3

        Sorry, For the IE version you must have SSI installed. :) Later, Caleb

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups