View Single Post
Old 02-12-2021, 10:12 PM  
sarettah
see you later, I'm gone
 
Industry Role:
Join Date: Oct 2002
Posts: 14,053
So based on what Fuzebox said, if you are hosting on cloudflare and were doing this with php you would want to check for Cloudflare's custom server var (HTTP_CF_CONNECTING_IP) for handling the ip.

Code:
  $clientip='';

  if (isset($_SERVER['HTTP_CF_CONNECTING_IP']) && $_SERVER['HTTP_CF_CONNECTING_IP'] != "")
  {
    $clientip = addslashes($_SERVER['HTTP_CF_CONNECTING_IP']);
  }
  elseif (isset($_SERVER['HTTP_CLIENT_IP']) && $_SERVER['HTTP_CLIENT_IP'] != "") 
  {
    $clientip = addslashes($_SERVER['HTTP_CLIENT_IP']);
  } 
  else if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR'] != "") 
  {
    $clientip = addslashes($_SERVER['HTTP_X_FORWARDED_FOR']);
  } 
  else 
  {
    $clientip = addslashes($_SERVER['REMOTE_ADDR']);
  }
.
__________________
All cookies cleared!
sarettah is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote