Get the true IP address of a visitor every time
Login or Register to Bookmark this snippet
As the title says, this method has always worked - and only uses one line of code!
<?php
$ip =
( !
empty($HTTP_SERVER_VARS['REMOTE_ADDR']) ) ?
$HTTP_SERVER_VARS['REMOTE_ADDR'] :
( ( !
empty($HTTP_ENV_VARS['REMOTE_ADDR']) ) ?
$HTTP_ENV_VARS['REMOTE_ADDR'] :
$REMOTE_ADDR );
?>
Added by JC on 12th November, 2007
There are no comments about this snippet.
You must be registered and logged in to post a comment.
Login here to post a comment