john pfeiffer
  • Home
  • Categories
  • Tags
  • Archives

php function get ip address

<?php
function get_ip_address()   // get accurate ip address of client
{
   if (getenv(HTTP_X_FORWARDED_FOR))
    {      $ip_temp = getenv(HTTP_X_FORWARDED_FOR);
    }
    else{   $ip_temp = getenv(REMOTE_ADDR); }

    return $ip_temp;
}
?>

  • « javascript chart
  • Load Testing with Apache Benchmark AB »

Published

May 30, 2016

Category

php

~19 words

Tags

  • address 7
  • function 14
  • get 22
  • ip 8
  • php 82