Get the IP address of the current user : REMOTE_ADDR « HTML « PHP






Get the IP address of the current user

 
<?php 
 
$curip = $_SERVER['REMOTE_ADDR']; 

$myarray = array (); 

if (!in_array ($curip, $myarray)){ 
    echo $curip . " is in array"; 
} else { 
    echo $curip . " is not in the database."; 
} 
?>
  
  








Related examples in the same category