Skip to content

Instantly share code, notes, and snippets.

@seanslater
Created January 6, 2016 02:36
Show Gist options
  • Save seanslater/c045e26e9e0d60886261 to your computer and use it in GitHub Desktop.
Save seanslater/c045e26e9e0d60886261 to your computer and use it in GitHub Desktop.
Cloudflare DNS: Get users actual IP address (otherwise $_SERVER['REMOTE_ADDR'] will show a range of Cloudflare IPs for all users)
<?php
if (isset($_SERVER['HTTP_CF_CONNECTING_IP'])) $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP'];
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment