Embed your data- in HTML 5

Simon Willison pointed out the part of the HTML 5 spec that discusses a way to add attributes to HTML elements for your own needs via data-. For example, a spaceship for a game: PLAIN TEXT HTML:   <div class="spaceship" data-id="9...

How to Get and Show IP Address Using PHP and JavaScript Print E-mail
User Rating: / 6
PoorBest 
This small tutorial will help you in learning how to get and show IP Address using PHP and JavaScript.

To Show IP Address via 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.";
?>

 

To show the IP Address via JavaScript 

 var ip= '<!--#echo var="REMOTE_ADDR"-->';
document.write("Your IP Address is :"+ip+" ");

 

 
< Prev   Next >