Hi SpiderWonam,
This is a good code to get the IP address and the host name:
Hope it works!
<script>
/* There are a few instances in which the browser cannot ascertain the user's address, so we will instruct the browser to ignore errors by setting the onerror handler to null: */
window . onerror = null;
/* We will also give hostaddress and hostname a default value in case the address look-up fails: */
hostaddress = hostname = "(unknown)";
/* Now we will try to gather the host information: */
localhost = java . net . InetAddress . getLocalHost ();
hostaddress = localhost . getHostAddress ();
hostname = localhost . getHostName ();
/* The Java methods used above are capable of throwing exceptions. When Java exceptions occur within JavaScript, the script body is aborted. In order to make sure that the following statements get a chance to execute, we must include them in a separate script body: */
</script>
<script>
document . writeln ("<p>Your IP address is <b>" + hostaddress + "</b>.</p>"

;
document . writeln ("<p>Your hostname is <b>" + hostname + "</b>.</p>"

;
</script>
It gives the Next result:
Your IP address is (unknown).
Your hostname is (unknown).
sbayter