Skip to content

Instantly share code, notes, and snippets.

@AndreiTelteu
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndreiTelteu/a45b1914529ccfb1b3c5 to your computer and use it in GitHub Desktop.
Save AndreiTelteu/a45b1914529ccfb1b3c5 to your computer and use it in GitHub Desktop.

Get the real IP of a visitor, when your website is using CloudFlare

<?php
if (isset($_SERVER["HTTP_CF_CONNECTING_IP"])) {
	$_SERVER['REMOTE_ADDR'] = $_SERVER["HTTP_CF_CONNECTING_IP"];
}
?>

Credits: http://stackoverflow.com/users/1279594/sharp12345

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment