ip help

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

  • ip help

    hello

    some users in my site uses opera mini or uc mini browser.their having 2 ips because opera mini ip also displays in their profile. eg. 106.79.83.85,107.167.108.205

    107.167.108.205 is opear mini server ip.... how can i show only 1 ip in their profile if users using opera mini or uc mini browser?

  • #2
    split the string by comma into array, and show the first or second value

    Comment


    • #3
      any other way except it?

      Comment


      • #4
        there is no way around it

        Comment


        • #5
          it didnt worked

          PHP Code:
          $uipadd mysql_fetch_array(mysql_query("SELECT ipadd FROM siteusers WHERE id='".$who."'"));
          $ip2=explode(",",$uipadd);
          if(
          strpos($ip2[0],",")){
          $web=explode(",",$uipadd);
          $uipadd=$web[0];
          }


            echo 
          "<center><b>Ip:</b> <a href="lists.php?action=byip&amp;who=$who">$uipadd</a></center>"
          Last edited by thunderwap; 10.08.15, 08:55.

          Comment


          • #6
            PHP Code:
            $db_arr mysql_fetch_array(mysql_query("SELECT ipadd FROM siteusers WHERE id='".$who."'"));
            $arr explode(',',$db_arr['ipadd']);
            $ip $arr[0];


              echo 
            '<center><b>Ip:</b> <a href="lists.php?action=byip&amp;who='.$who.'">'.$ip.'</a></center>'

            Comment


            • #7
              Originally posted by GumSlone View Post
              PHP Code:
              $db_arr mysql_fetch_array(mysql_query("SELECT ipadd FROM siteusers WHERE id='".$who."'"));
              $arr explode(',',$db_arr['ipadd']);
              $ip $arr[0];


              echo 
              '<center><b>Ip:</b> <a href="lists.php?action=byip&amp;who='.$who.'">'.$ip.'</a></center>'
              i tried as u given code.but still not working.same problem as like before

              Comment


              • #8
                but how? it should show only 1 ip with the code above

                Comment


                • #9
                  it shows both ip as like before. i done as you said in above code.there is no error it showing but it performs the same task as like before.

                  Comment


                  • #10
                    PHP Code:
                    $arr explode(',',$db_arr['ipadd']); 
                    this code explodes comma separated ip,

                    PHP Code:
                    $ip $arr[0]; 
                    this one will show the first ip, even if there are no comma separated list

                    Comment


                    • #11
                      strange. seems to work for me. when testing it.
                      Last edited by Ghost; 14.08.15, 13:39.

                      Comment


                      • #12
                        I think it shows 106.79.83.85107.167.108.205 or 106.79.83.85 107.167.108.205 and not 106.79.83.85,107.167.108.205

                        Comment


                        • #13
                          Originally posted by GumSlone View Post
                          PHP Code:
                          $arr explode(',',$db_arr['ipadd']); 
                          this code explodes comma separated ip,

                          PHP Code:
                          $ip $arr[0]; 
                          this one will show the first ip, even if there are no comma separated list
                          thanks for info.

                          explode means to convert string into array by using comma? is it rite?

                          and

                          implode means to convert array into string by using comma? is it rite?
                          Last edited by thunderwap; 15.08.15, 07:17.

                          Comment


                          • #14
                            Originally posted by thunderwap View Post
                            thanks for info.

                            explode means to convert string into array by using comma? is it rite?

                            and

                            implode means to convert array into string by using comma? is it rite?
                            yes correct, but it can be comma or any other symbol that you assign to the function

                            Comment


                            • #15
                              Originally posted by kevk3v View Post
                              I think it shows 106.79.83.85107.167.108.205 or 106.79.83.85 107.167.108.205 and not 106.79.83.85,107.167.108.205
                              the ips from opera mini / ucweb and other proxy browser are usually listed by comma, anyway it seems that he has some different values in the database

                              Comment

                              Working...
                              X