Jump to content

Recommended Posts

  • 4 years later...

Posted

Foarte bun tutorialul, m-a ajutat... Am vrut sa-mi fac o pagina gen Lakers.. :) Domeniu.ro/IP sau ceva de genul ;)

ECILA.RO gaming network

  • Moderators
Posted

Si daca foloseste proxy?

<?php

function getUserIP()
{
    $client  = @$_SERVER['HTTP_CLIENT_IP'];
    $forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];
    $remote  = $_SERVER['REMOTE_ADDR'];

    if( filter_var( $client, FILTER_VALIDATE_IP ) )
    {
        $ip = $client;
    }
    elseif( filter_var( $forward, FILTER_VALIDATE_IP ) )
    {
        $ip = $forward;
    }
    else
    {
        $ip = $remote;
    }

    return $ip;
}


$user_ip = getUserIP();

echo $user_ip; // Output IP address [Ex: 177.87.193.134]

?>
  • Upvote 1

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.