Ip2country

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

    #16
    somethin like this shld work jus set $who to be the uid
    of the person u wana get the network from

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

    Comment


      #17
      somethin like this shld work jus set $who to be the uid
      of the person u wana get the network from

      Code:
      $ip=mysql_fetch_array(mysql_query("SELECT ipadd FROM ibwf_users WHERE id='".$who."'"));
      $ip2=explode(",",$ip);
      if(strpos($ip2[0],",")){
      $exp_ip=explode(",",$ip);
      $ip=$exp_ip[0];
      }
      [/b]
      $ip = mysql_fetch_array(mysql_query("SELECT ipadd FROM ibwf_users WHERE id='".$who."'"));
      $ip2=explode(",",$ip);
      if(strpos($ip2[0],",")){
      $exp_ip=explode(",",$ip);
      $ip=$exp_ip[0];
      }echo "network:
      ".network(ip(),1);


      do u maen this?

      Comment


        #18
        $ip = mysql_fetch_array(mysql_query("SELECT ipadd FROM ibwf_users WHERE id='".$who."'"));
        $ip2=explode(",",$ip);
        if(strpos($ip2[0],",")){
        $exp_ip=explode(",",$ip);
        $ip=$exp_ip[0];
        }echo "network:
        ".network(ip(),1);
        do u maen this?[/b]

        mrbling notice this line .network(ip(),1);

        here ip() is in network function,if you dnt declare all the needed functions previously how can they work for you?


        ori has told you everything by which a baby can apply this codes

        Comment


          #19
          echo "network:
          ".network($ip,1);

          Comment


            #20
            4 all of yous that dnt have the country flag images i get mine from here http://www.3dflags.com if yous build up anymmore networks can u list them here fanx

            Comment


              #21
              4 all of yous that dnt have the country flag images i get mine from here http://www.3dflags.com if yous build up anymmore networks can u list them here fanx[/b]
              still not working i add this tho the user profiles

              $ip = mysql_fetch_array(mysql_query("SELECT ipadd FROM ibwf_users WHERE id='".$who."'"));
              echo "network:
              ".network($ip,1);

              Comment


                #22
                still not working i add this tho the user profiles

                $ip = mysql_fetch_array(mysql_query("SELECT ipadd FROM ibwf_users WHERE id='".$who."'"));
                echo "network:
                ".network($ip,1);[/b]
                please help me out

                Comment


                  #23
                  my flag not showin ori why?
                  Failure is not when a girls leaves you, its only when you let her go virgin. heheh!!

                  <span style="color:#9ACD32"><span style="font-size:36pt;line-height:100%">BEST MOBILE ADVERTISER</span></span>

                  Comment


                    #24
                    check the directory where the flags are they may just b mislinked... and bling change $ip to $ip[0]

                    Comment


                      #25
                      check the directory where the flags are they may just b mislinked... and bling change $ip to $ip[0][/b]
                      now working the flags only the worng one i see the same at every profile

                      Comment


                        #26
                        post ur view profile code then and ill edit what u need to get it working

                        Comment


                          #27
                          post ur view profile code then and ill edit what u need to get it working[/b]
                          this code i use into my usersprofiles


                          $ip[0] = mysql_fetch_array(mysql_query("SELECT ipadd FROM ibwf_users WHERE id=&#39;".$who."&#39;"));
                          echo "Country:".network($ip,1);


                          this code i use into the core


                          function ip()
                          {
                          if($_SERVER["REMOTE_ADDR"]){$ip=$_SERVER["REMOTE_ADDR"];}
                          else{$ip=$_SERVER["HTTP_X_FORWARDED_FOR"];}
                          if(strpos($ip,",")){
                          $exp_ip=explode(",",$ip);
                          $ip=$exp_ip[0];
                          }
                          return $ip;
                          }

                          function ipinrange($ip, $range1, $range2)
                          {
                          $ip=ip2long($ip);
                          $range1=ip2long($range1);
                          $range2=ip2long($range2);
                          return (($ip >= $range1) && ($ip <= $range2));
                          }

                          function network($ip,$opt)
                          {
                          $result=mysql_query("SELECT * FROM network ORDER BY subone, subtwo");
                          while($ranges=mysql_fetch_array($result)){
                          if(ipinrange($ip, $ranges[1], $ranges[2])){
                          if(is_file("flags/".$ranges["flag"])&&$opt==1){
                          $flag="<img src=\"flags/".$ranges["flag"]."\" alt=\"".$ranges["flag"]."\"/>
                          ";
                          }
                          return $flag.$ranges["isp"]." ".$ranges["country"];
                          }
                          }
                          }

                          Comment


                            #28
                            this is mine:

                            $ip = mysql_fetch_array(mysql_query("SELECT ipadd FROM ibwf_users WHERE id=&#39;".$who."&#39;"));
                            echo "network:
                            ".network($ip[0]);



                            and my core


                            function ip()
                            {
                            if($_SERVER["REMOTE_ADDR"]){$ip=$_SERVER["REMOTE_ADDR"];}
                            else{$ip=$_SERVER["HTTP_X_FORWARDED_FOR"];}
                            if(strpos($ip,",")){
                            $exp_ip=explode(",",$ip);
                            $ip=$exp_ip[0];
                            }
                            return $ip;
                            }

                            function ipinrange($ip, $range1, $range2)
                            {
                            $ip=ip2long($ip);
                            $range1=ip2long($range1);
                            $range2=ip2long($range2);
                            return (($ip >= $range1) && ($ip <= $range2));
                            }

                            function network($ip)
                            {
                            $result=mysql_query("SELECT * FROM network ORDER BY subone, subtwo");
                            while($ranges=mysql_fetch_array($result)){
                            if(ipinrange($ip, $ranges[1], $ranges[2])){
                            if(is_file("flags/".$ranges["flag"])&&$opt==1){
                            $flag="<img src=\"flags/".$ranges["flag"]."\" alt=\"".$ranges["flag"]."\"/>
                            ";
                            }
                            return $flag.$ranges["isp"]." ".$ranges["country"];
                            }
                            }
                            }



                            this works fine for me, just gotta add more networks/ISP lol




                            Comment


                              #29
                              yeh thats rite way of doing it lol mrbling use the code killaklan put heres mine on my new script pmpl

                              since u seen my other functions this only 1 in the code that wasnt posted

                              function subno()
                              {
                              if($_SERVER["HTTP_X_UP_SUBNO"]){$subno=$_SERVER["HTTP_X_UP_SUBNO"];}
                              else{$subno=gethostbyaddr(ip());}
                              if($subno==""){
                              $exp_ip=explode(",",ip());
                              $subno=gethostbyaddr($exp_ip[0]);
                              }
                              return $subno;
                              }

                              Code:
                              $browser=browser();
                              $ip=ip();
                              $network=network($ip,1);
                              $db_network=network($ip,0);
                              if($network==""||$db_network==""){
                              $network=subno();
                              $db_network=subno();
                              db_query("INSERT INTO logs SET action=&#39;network&#39;, details=&#39;".ip()."&#39;, date=&#39;".time()."&#39;","i");
                              }
                              Code:
                              echo "[b]browser:[/b]
                              
                              ".browser()."
                              
                              [b]ip:[/b]
                              
                              ".ip()."
                              
                              [b]network:[/b]
                              
                              ".network(ip(),1);
                              }

                              Comment


                                #30
                                yeh thats rite way of doing it lol mrbling use the code killaklan put heres mine on my new script pmpl

                                since u seen my other functions this only 1 in the code that wasnt posted

                                function subno()
                                {
                                if($_SERVER["HTTP_X_UP_SUBNO"]){$subno=$_SERVER["HTTP_X_UP_SUBNO"];}
                                else{$subno=gethostbyaddr(ip());}
                                if($subno==""){
                                $exp_ip=explode(",",ip());
                                $subno=gethostbyaddr($exp_ip[0]);
                                }
                                return $subno;
                                }

                                Code:
                                $browser=browser();
                                $ip=ip();
                                $network=network($ip,1);
                                $db_network=network($ip,0);
                                if($network==""||$db_network==""){
                                $network=subno();
                                $db_network=subno();
                                db_query("INSERT INTO logs SET action=&#39;network&#39;, details=&#39;".ip()."&#39;, date=&#39;".time()."&#39;","i");
                                }
                                Code:
                                echo "[b]browser:[/b]
                                
                                ".browser()."
                                
                                [b]ip:[/b]
                                
                                ".ip()."
                                
                                [b]network:[/b]
                                
                                ".network(ip(),1);
                                }
                                [/b]
                                dnt work mate sorry

                                Comment

                                Working...
                                X