Join the community today
Become a Member

Strange Real IP Address Issue

Discussion in 'Other Web Apps usage' started by xaitmi, Apr 7, 2016.

  1. xaitmi

    xaitmi Member

    35
    3
    8
    Jan 18, 2015
    Ratings:
    +3
    Local Time:
    10:22 PM
    I have CentMinMod running on a server.

    PHP:
    <?
    function 
    getRealIpAddr()
    {
        if (!empty(
    $_SERVER['HTTP_CLIENT_IP']))   //check ip from share internet
        
    {
            
    $ip=$_SERVER['HTTP_CLIENT_IP'];
        }
        elseif (!empty(
    $_SERVER['HTTP_X_FORWARDED_FOR']))   //to check ip is pass from proxy
        
    {
            
    $ip=$_SERVER['HTTP_X_FORWARDED_FOR'];
        }
        else
        {
            
    $ip=$_SERVER['REMOTE_ADDR'];
        }
        return 
    $ip;
    }

    echo 
    getRealIpAddr();
    ?>
    Basically it returns this.

    MyIPaddress, MyIPAddress

    so like

    99.XX.XX.XXX,99.XX.XX.XXX

    Anyone know why it does that? I only need my IP to show once, because it's causing problems with an application I am coding.
     
  2. Ahmad

    Ahmad Active Member

    209
    80
    28
    Apr 13, 2015
    Ratings:
    +150
    Local Time:
    4:22 AM
    1.9.9
    10.1.10
    • Informative Informative x 1