This is get your IP address .it work on online only it give to your IP address.get IP address different way in the PHP . In PHP as used $_SERVER['REMOTE_ADDR'] ; and getenv("REMOTE_ADDR") ; to get IP address easy.
Method 1
<?php
//Gets the IP address using $_SERVER['REMOTE_ADDR'] ;
$ip =$_SERVER['REMOTE_ADDR'] ;
echo "Your IP is " . $ip;
?>
//Gets the IP address using $_SERVER['REMOTE_ADDR'] ;
$ip =$_SERVER['REMOTE_ADDR'] ;
echo "Your IP is " . $ip;
?>
Method 2
<?php
//Gets the IP address using getenv("REMOTE_ADDR") ;
$ip = getenv("REMOTE_ADDR") ;
echo "Your IP is " . $ip;
?>
//Gets the IP address using getenv("REMOTE_ADDR") ;
$ip = getenv("REMOTE_ADDR") ;
echo "Your IP is " . $ip;
?>
No comments:
Post a Comment