public function _ip() {
if(preg_match( "/^([d]{1,3}).([d]{1,3}).([d]{1,3}).([d]{1,3})$/", getenv('HTTP_X_FORWARDED_FOR'))) {
return getenv('HTTP_X_FORWARDED_FOR');
}
return getenv('REMOTE_ADDR');
}
Obtains the IP address of the person viewing your website.
Easy way to save IP address to database for security reasons
Easy way to save IP address to database for security reasons
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.