Quest for Remote IP Detector

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Quest for Remote IP Detector

    Hello, I want a script that can detect user's remote IP. Generally when a user uses opera mini we don't get his real IP. As example, when a user of my site comes with his Nokia Nokia7210Supernova/2.0 his IP is 117.99.1.237 at the same time when he comes with opera mini his IP is 64.225.18.137. It seems that opera mini works here like a proxy IP. I just want his real IP ( 117.99.1.237 ) even when he uses opera mini. That's all.

    If any coder can know the code plz post here and help me.
    Thanks.
    Wait...
    sigpic

    #2
    Originally posted by anderson View Post
    Hello, I want a script that can detect user's remote IP. Generally when a user uses opera mini we don't get his real IP. As example, when a user of my site comes with his Nokia Nokia7210Supernova/2.0 his IP is 117.99.1.237 at the same time when he comes with opera mini his IP is 64.225.18.137. It seems that opera mini works here like a proxy IP. I just want his real IP ( 117.99.1.237 ) even when he uses opera mini. That's all.

    If any coder can know the code plz post here and help me.
    Thanks.
    mate.,hope this would help you..try this one:
    PHP Code:
     if(!empty($_SERVER['HTTP_CLIENT_IP']))
     {
     
    $ip $_SERVER['HTTP_CLIENT_IP'];
     }
     else if(!empty(
    $_SERVER['HTTP_X_FORWARDED_FOR']))
     {
     
    $ip $_SERVER['HTTP_X_FORWARDED_FOR'];
     }
     else if(!empty(
    $_SERVER['REMOTE_ADDR']))
    {
     
    $ip $_SERVER['REMOTE_ADDR'];
     }else{
     
    $ip "Unknown";
     }
    echo 
    $ip
    Last edited by kiLLeR-eyEd_14; 30.08.09, 06:40.
    My Blog: http://jhommark.blogspot.com
    My Facebook: http://www.facebook.com/jhommark
    My Official Site: http://www.undergroundweb.tk
    My Community Site: http://undergroundwap.xtreemhost.com

    Comment


      #3
      hope this may help yuh ....

      i use this function in ma script ....call this function anywhere u need original ip of a user....
      Code:
      function getip(){
      
      if (getenv('HTTP_X_FORWARDED_FOR')){
      
      $ip=getenv('HTTP_X_FORWARDED_FOR');
      
      }else{
      
      $ip=getenv('REMOTE_ADDR');
      
      }
      
      return $ip;
      
      }

      Comment


        #4
        <?php
        echo "X-Forworded for : ". $_SERVER['HTTP_X_FORWARDED_FOR'];
        echo "<br>";
        echo "Remote Address : ". $_SERVER['REMOTE_ADDR'];
        echo "<br>";
        echo "+". $_SERVER['HTTP_X_MSISDN'];
        echo "<br>";
        echo "Network : ". $_SERVER['HTTP_X_NETWORK_INFO'];
        echo "<br>";
        echo "Via : ". $_SERVER['HTTP_VIA'];
        ?>

        Comment


          #5
          I used all of ur codes earlier but none of them working.
          Wait...
          sigpic

          Comment


            #6
            I am writing here a code. I will be grateful if anyone inform me by testing it if it is working for detecting real IP or not when a user uses proxy/opera mini.
            Thanks.
            PHP Code:
            function validip($ip) {
             
            if (!empty(
            $ip) && ip2long($ip)!=-1) {
             
            $reserved_ips = array (
             
            array(
            '0.0.0.0','2.255.255.255'),
             
            array(
            '10.0.0.0','10.255.255.255'),
             
            array(
            '127.0.0.0','127.255.255.255'),
             
            array(
            '169.254.0.0','169.254.255.255'),
             
            array(
            '172.16.0.0','172.31.255.255'),
             
            array(
            '192.0.2.0','192.0.2.255'),
             
            array(
            '192.168.0.0','192.168.255.255'),
             
            array(
            '255.255.255.0','255.255.255.255')
             
            );
             
             
            foreach (
            $reserved_ips as $r) {
             
            $min ip2long($r[0]);
             
            $max ip2long($r[1]);
             
            if ((
            ip2long($ip) >= $min) && (ip2long($ip) <= $max)) return false;
             
            }
             
            return 
            true;
             
            } else {
             
            return 
            false;
             
            }
             }
             
             function 
            getip() {
             
            if (
            validip($_SERVER["HTTP_CLIENT_IP"])) {
             
            return 
            $_SERVER["HTTP_CLIENT_IP"];
             
            }
             
            foreach (
            explode(",",$_SERVER["HTTP_X_FORWARDED_FOR"]) as $ip) {
             
            if (
            validip(trim($ip))) {
             
            return 
            $ip;
             
            }
             
            }
             
            if (
            validip($_SERVER["HTTP_X_FORWARDED"])) {
             
            return 
            $_SERVER["HTTP_X_FORWARDED"];
             
            } elseif (
            validip($_SERVER["HTTP_FORWARDED_FOR"])) {
             
            return 
            $_SERVER["HTTP_FORWARDED_FOR"];
             
            } elseif (
            validip($_SERVER["HTTP_FORWARDED"])) {
             
            return 
            $_SERVER["HTTP_FORWARDED"];
             
            } elseif (
            validip($_SERVER["HTTP_X_FORWARDED"])) {
             
            return 
            $_SERVER["HTTP_X_FORWARDED"];
             
            } else {
             
            return 
            $_SERVER["REMOTE_ADDR"];
             
            }
             }
             
            ?> 
            Wait...
            sigpic

            Comment


              #7
              thanks it works for me :D

              Comment


                #8
                Originally posted by kiss of death View Post
                thanks it works for me :D
                how u used it. plz explain details. which proxy u used?
                Wait...
                sigpic

                Comment


                  #9
                  but this function must be put in core.php file or another file?

                  Comment


                    #10
                    Originally posted by anderson View Post
                    Hello, I want a script that can detect user's remote IP. Generally when a user uses opera mini we don't get his real IP. As example, when a user of my site comes with his Nokia Nokia7210Supernova/2.0 his IP is 117.99.1.237 at the same time when he comes with opera mini his IP is 64.225.18.137. It seems that opera mini works here like a proxy IP. I just want his real IP ( 117.99.1.237 ) even when he uses opera mini. That's all.

                    If any coder can know the code plz post here and help me.
                    Thanks.

                    Here is the code to get the remote IP and real browser when a member use Opera Mini.
                    Opera Mini | Charlie&#039;s BLOG

                    Comment

                    Working...
                    X