Before we see how to display the IP Address let us learn little bit about IP Address. Whenever you are connected to internet you are assigned an IP address. This distinguishes your computer from other computers on the internet. Your IP Address can be static or dynamic. The following code can be used to get and show the IP Address on the webpage.
Javascript
var ip= '<!--#echo var="REMOTE_ADDR"-->';
document.write("Your IP Address is :"+ip+" ");
document.write("Your IP Address is :"+ip+" ");
ASP
request.ServerVariables("REMOTE_ADDR")
PHP
<?
$remote_address = getenv("REMOTE_ADDR");
echo "Your IP address is $remote_address.";
$browser_type = getenv("HTTP_USER_AGENT");
echo "You are using $browser_type.";
?>
$remote_address = getenv("REMOTE_ADDR");
echo "Your IP address is $remote_address.";
$browser_type = getenv("HTTP_USER_AGENT");
echo "You are using $browser_type.";
?>
0 comments to "To Get And Show The IP Address"
About This Blog
This is a place where I write about the things I find interesting and are worth to share.
Share it
Labels
- asp (1)
- CSS (1)
- Google (1)
- Html (4)
- Humour (3)
- introduction (1)
- Javascript (3)
- php (2)
- Templates (1)
- Ubuntu (2)
- Under Construction Templates (1)
- Wallpapers (2)
Post a Comment