To get client IP Address follow these example code:
<?php // Get the client ip address if (!empty($_SERVER['HTTP_CLIENT_IP'])) { echo $ip = $_SERVER['HTTP_CLIENT_IP']; } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { echo $ip = $_SERVER['HTTP_X_FORWARDED_FOR']; } else { echo $ip = $_SERVER['REMOTE_ADDR']; } ?>
Question and answer is powered by AnsPress.io