Welcome Guest, Not a member yet? Register   Sign In
Hit Counter in Post by ip address
#4

[eluser]LuckyFella73[/eluser]
To get the ip you can use this php function:

Code:
function get_client_ip()
{
        if (!empty($_SERVER['HTTP_CLIENT_IP']))
  {
   $ip = $_SERVER['HTTP_CLIENT_IP'];
        }
  elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
  {
            $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
        }
  else
  {
            $ip = $_SERVER['REMOTE_ADDR'];
        }
        return $ip;
    }

In the controller calling the view do

Code:
$ip = get_client_ip();
// then do something with that value


Messages In This Thread
Hit Counter in Post by ip address - by El Forum - 08-10-2012, 01:13 AM
Hit Counter in Post by ip address - by El Forum - 08-10-2012, 04:28 AM
Hit Counter in Post by ip address - by El Forum - 08-10-2012, 04:56 AM
Hit Counter in Post by ip address - by El Forum - 08-10-2012, 05:03 AM
Hit Counter in Post by ip address - by El Forum - 08-14-2012, 08:01 PM
Hit Counter in Post by ip address - by El Forum - 08-15-2012, 01:38 AM
Hit Counter in Post by ip address - by El Forum - 08-15-2012, 02:49 AM



Theme © iAndrew 2016 - Forum software by © MyBB