Simple PHP program to get IP address and name of Client
<?php
echo "<h3>Welcome ! Your IP address is: " .$_SERVER['REMOTE_ADDR'];
echo "<br/>Your Computer Name is: ".$_SERVER['HTTP_HOST']."</h3>";
?>
PHP has $_SERVER superglobal array which provides important information about Client and Server.
$_SERVER['REMOTE_ADDR'] - gives IP address of Client accessing website.
$_SERVER['HTTP_HOST'] - gives Host name of Client accessing website.
No comments:
Post a Comment
Thanks for visiting my Blog!