Country Detecter Script Help

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

    #31
    i use the 1 from the wapside script if theres a network it dnt recognise i get the ip ranges for that network and add them to my db easy as

    Comment


      #32
      Yeah u would have to add your ip if it is not found in the database
      if u want a full list of all the ip and country u would have to buy it!

      Comment


        #33
        Yeah u would have to add your ip if it is not found in the database
        if u want a full list of all the ip and country u would have to buy it![/b]
        or download a geoip database google hard enough and you will find some

        Comment


          #34
          is it wml? i need wml...

          Comment


            #35
            its here amy, GEOip db! found it on ubuntu forums, its a CSV file. but i dont have script to convert CSV to SQL.
            Attached Files

            Comment


              #36
              someone please post ip to country codes for rw script please including everythin. spiderwap u have it also lamar does why don't u people share it?
              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


                #37
                someone please post ip to country codes for rw script please including everythin. spiderwap u have it also lamar does why don&#39;t u people share it?[/b]
                i dnt use ravingwap script but im sure the code i posted in other topic will work jus modify it to ur script to get it to work and also csv files can be imported into phpmyadmin ive done it on mine jus choose the import format as csv lol

                Comment


                  #38
                  I&#39;m trying to work my own code out, if i get anything right i&#39;ll post, but my plan will just have to work...

                  In a guys profile his phone and ip shows right?

                  I&#39;m using a ip2country thing on my main site, gana see how its done in profiles with phone make and ip and follow that same example using ip2country... dont think it will be to difficult.....

                  Click here!!!

                  Comment


                    #39
                    bro wht did u just ask to change? ip(0) where?
                    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


                      #40
                      bro wht did u just ask to change? ip(0) where?[/b]
                      See this post maby it helping you out

                      ip2country post

                      Comment


                        #41
                        The ip2country script that spiderwap got was posted here somewere! 1st of all it only shows the 1st letter of a country and the flags are big and damn ugly! Hey sagar check if your country shows in profile on my site!

                        click here to join blingywap.co.za
                        http://blingywap.co.za


                        IF YOU NEED HELP JUST ASK AND ALWAYS SAY THANK YOU!

                        Comment


                          #42
                          give me in lavalair sc :?

                          Comment


                            #43
                            Code:
                            public function getcountry_uid($uid)
                                {
                                    $DB = new DB;
                                    $ip = $DB->FetchArray($DB->Query("SELECT IPAdd FROM {$GLOBALS['prefix']}members WHERE ID='".$uid."'"));
                                    $ip = long2ip(ip2long($ip[0]));
                                    $res = $DB->Query("SELECT ISO2 FROM {$GLOBALS['prefix']}ips WHERE (StartIP <= inet_aton('".$ip."') AND EndIP >= inet_aton('".$ip."'))");
                                    if($get = $DB->FetchArray($res))
                                    {
                                        $country = $DB->Query("SELECT CountryName FROM {$GLOBALS['prefix']}country WHERE ISO2 = '".$get[0]."'");
                                        if($name = $DB->FetchArray($country))
                                        {
                                            $CountryName = $name[0];
                                        }else{
                                            $CountryName = 'Unknown';
                                        }
                                    }else{
                                        $CountryName = 'Unknown';
                                    }
                                    return $CountryName;
                                }
                            
                                public function getcountry()
                                {
                                    $DB = new DB;
                                    $ip = $this->getip();
                                    $ip = long2ip(ip2long($ip));
                                    $res = $DB->Query("SELECT ISO2 FROM {$GLOBALS['prefix']}ips WHERE (StartIP <= inet_aton('".$ip."') AND EndIP >= inet_aton('".$ip."'))");
                                    if($get = $DB->FetchArray($res))
                                    {
                                        $country = $DB->Query("SELECT CountryName FROM {$GLOBALS['prefix']}country WHERE ISO2 = '".$get[0]."'");
                                        if($name = $DB->FetchArray($country))
                                        {
                                            $CountryName = $name[0];
                                        }else{
                                            $CountryName = 'Unknown';
                                        }
                                    }else{
                                        $CountryName = 'Unknown';
                                    }
                                    return $CountryName;
                                }
                                
                                public function getcountryflag($country)
                                {
                                    $DB = new DB;
                                    $iso = $DB->Query("SELECT ISO2 FROM {$GLOBALS['prefix']}country WHERE CountryName='".$country."'");
                                    if($flag = $DB->FetchArray($iso))
                                    {
                                        $temp = strtolower($flag[0]);
                                        if(is_file('Images/Country_Flags/'.$temp.'.png'))
                                        {
                                            $flagurl = 'Images/Country_Flags/'.$temp.'.png';
                                        }else{
                                            $flagurl = 'Images/Country_Flags/noflag.png';
                                        }
                                    }else{
                                        $flagurl = 'Images/Country_Flags/noflag.png';
                                    }
                                    return $flagurl;
                                }
                                public function getip()
                                {
                                    if (isset($_SERVER))
                                    {
                                        if(isset($_SERVER["HTTP_X_FORWARDED_FOR"]))
                                        {
                                            $ip = $_SERVER["HTTP_X_FORWARDED_FOR"];
                            
                                        }else if(isset($_SERVER["HTTP_CLIENT_IP"]))
                                        {
                                            $ip = $_SERVER["HTTP_CLIENT_IP"];
                            
                                        }else{
                                            $ip = $_SERVER["REMOTE_ADDR"];
                                        }
                            
                                    }else{
                                        if(getenv('HTTP_X_FORWARDED_FOR'))
                                        {
                                            $ip = getenv('HTTP_X_FORWARDED_FOR');
                            
                                        }else if(getenv('HTTP_CLIENT_IP'))
                                        {
                                            $ip = getenv('HTTP_CLIENT_IP');
                            
                                        }else {
                                            $ip = getenv('REMOTE_ADDR');
                                        }
                                    }
                                    return $ip; 
                                }
                            u can modify this code to get it
                            Attached Files

                            Comment


                              #44
                              i dont understand ..

                              but i wan try diz code "

                              Comment


                                #45
                                what do we do to update country lists in db? i don&#39;t know do we have to change the csv or the db?
                                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

                                Working...
                                X