Country Detecter Script Help

Started on the old forum in December 2006 · view the original in the archive · old links redirect here

47 replies · 6,897 views · started 19 years ago · 1 min read

TL;DR · summary of 47 replies
  • - The script provided by GumSlone works with PHP scripts, including Fun Mobile and Lavalair WML.
  • - To reserve one user's $two_letter_country_code data in the database for showing to all users, additional columns need to be added to the MySQL table used for storing user profiles.
  • - For detecting country using IP addresses without a database, GumSlone suggested an alternative script available at
  • - The thread concluded that some country detection scripts may not accurately detect users' locations due to intermediaries and the need for paid services.

Written automatically from the replies by a language model on our own server. It can be wrong; the posts below are the source.

15 participants
Guest #21

many thanks to Gum, 1 more question,how can i reserve one user's $two_letter_country_code data in that user's profile to show that user's $two_letter_country_code to all user,i mean wt will b mysql table to save n show $two_letter_country_code to all users?

Well yea there is a simple way of doing this in a user friendly way... That is not displaying country code to other users as 2 letter code, instead show it as full name of country...
As Gumslone suggested, this can be made easy if ur ip2country database has a separate column which displays country's name as a a whole... If so its a matter of getting value from approapriate column and inserting that data into users profile in ur database...

External image (may be gone)

Guest #22

ooh man check this http://ip2location.com, it shows my country, state and the city. and my connection through... i want the codes to show the state and city. does anyone have it?

GumSlone Administrator Principal · 1,690 posts #23

ooh man check this http://ip2location.com, it shows my country, state and the city. and my connection through... i want the codes to show the state and city. does anyone have it?

it would not work with mobile phone users only with pc users also you have to pay for this service and its also does not show correct information as for me.

Advertise your mobile site for FREE with AdTwirl

External image (may be gone)

rukiya Lead · 569 posts #24

Hmmm, i dont realy understand what do you mean, and i dont know which mysql tables are you using External image (may be gone) so here is very simple example: you have to add the country row to your users table

UPDATE `users` SET `country`='".$two_letter_country_code."' WHERE id='".$user_id."'

and to select users (South africans)

SELECT * FROM `users` WHERE `country`='ZA' LIMIT 0, 10

well im using lavalair wml script

here is user sql table

-- -- Table structure for table ibwf_users

CREATE TABLE ibwf_users ( id int(100) NOT NULL auto_increment, name varchar(30) NOT NULL default '', pass varchar(60) NOT NULL default '', birthday varchar(50) NOT NULL default '', sex char(1) NOT NULL default '', location varchar(100) NOT NULL default '', perm char(1) NOT NULL default '0', posts int(100) NOT NULL default '0', plusses int(100) NOT NULL default '0', signature varchar(100) NOT NULL default '', avatar varchar(100) NOT NULL default '', email varchar(50) NOT NULL default '', site varchar(50) NOT NULL default '', browserm varchar(50) NOT NULL default '', ipadd varchar(30) NOT NULL default '', lastact int(100) NOT NULL default '0', regdate int(100) NOT NULL default '0', chmsgs int(100) NOT NULL default '0', chmood int(100) NOT NULL default '0', shield char(1) NOT NULL default '0', gplus int(100) NOT NULL default '0', budmsg varchar(100) NOT NULL default '', lastpnreas varchar(100) NOT NULL default '', lastplreas varchar(100) NOT NULL default '', shouts int(100) NOT NULL default '0', pollid int(100) NOT NULL default '0', rbcid varchar(255) NOT NULL default '', hvia char(1) NOT NULL default '1', lastvst int(100) NOT NULL default '0', battlep int(100) NOT NULL default '0', PRIMARY KEY (id), UNIQUE KEY name (name), KEY id (id) ) TYPE=MyISAM AUTO_INCREMENT=1 ;

-- -- Dumping data for table ibwf_users

and

i want to show in users profile like this

More Information

Send PM

add to buddy list

Member's ID: Status: Vinyl Shaker A/S/L: 18/Male/ IP country:South Africa Flag image Topics: 9 Posts: 127/152 PMs IN: 26 - OUT: 52 Game Plusses: 93 Chat Posts: 22 Fun Points: 0 Shouts: 28/42 Joined rw: 02 07 07-17:23:51 Last Active: 07 10 07-18:20:37 Last Visit: 07 10 07-12:13:11 Browser: Opera E-mail: Signature:

Attachments: index.php core.php
Guest #25

most of the country dedeceter scripts, doesnt detect my country from ip at all. it says unknown country. Where as this one showed exact location of me... and yeah its payable service External image (may be gone)

Guest #26

most of the country dedeceter scripts, doesnt detect my country from ip at all. it says unknown country. Where as this one showed exact location of me... and yeah its payable service External image (may be gone)

Bro pls check country detector in my site and let me know if it doesnt detect ur country...

Guest #27

it would not work with mobile phone users only with pc users also you have to pay for this service and its also does not show correct information as for me.

Agree with u Gums... U have to pay for the service and what it detects is the nearest exchange of your internet service provider. Which doesn't always be your hometown.. Similar scripts are used in many porn sites etc just to lure users ... But funny side of it is when it shows a city about 50-100 kms from your city... This happens coz most of the ip2loaction services only use ip to detect the location, and user ip may be interfered by many intermediates..

Guest #29

Bro pls check country detector in my site and let me know if it doesnt detect ur country...

oh yeah bro the country scrip on your site dedects my country. it also says im from south india. Which script are you using bro?

blackhowk Senior · 411 posts #30

well im using lavalair wml script here is user sql table

-- -- Table structure for table ibwf_users

CREATE TABLE ibwf_users ( id int(100) NOT NULL auto_increment, name varchar(30) NOT NULL default '', pass varchar(60) NOT NULL default '', birthday varchar(50) NOT NULL default '', sex char(1) NOT NULL default '', location varchar(100) NOT NULL default '', perm char(1) NOT NULL default '0', posts int(100) NOT NULL default '0', plusses int(100) NOT NULL default '0', signature varchar(100) NOT NULL default '', avatar varchar(100) NOT NULL default '', email varchar(50) NOT NULL default '', site varchar(50) NOT NULL default '', browserm varchar(50) NOT NULL default '', ipadd varchar(30) NOT NULL default '', lastact int(100) NOT NULL default '0', regdate int(100) NOT NULL default '0', chmsgs int(100) NOT NULL default '0', chmood int(100) NOT NULL default '0', shield char(1) NOT NULL default '0', gplus int(100) NOT NULL default '0', budmsg varchar(100) NOT NULL default '', lastpnreas varchar(100) NOT NULL default '', lastplreas varchar(100) NOT NULL default '', shouts int(100) NOT NULL default '0', pollid int(100) NOT NULL default '0', rbcid varchar(255) NOT NULL default '', hvia char(1) NOT NULL default '1', lastvst int(100) NOT NULL default '0', battlep int(100) NOT NULL default '0', PRIMARY KEY (id), UNIQUE KEY name (name), KEY id (id) ) TYPE=MyISAM AUTO_INCREMENT=1 ;

-- -- Dumping data for table ibwf_users

and

i want to show in users profile like this More Information

Send PM

add to buddy list Member's ID: Status: Vinyl Shaker A/S/L: 18/Male/ IP country:South Africa Flag image Topics: 9 Posts: 127/152 PMs IN: 26 - OUT: 52 Game Plusses: 93 Chat Posts: 22 Fun Points: 0 Shouts: 28/42 Joined rw: 02 07 07-17:23:51 Last Active: 07 10 07-18:20:37 Last Visit: 07 10 07-12:13:11 Browser: Opera E-mail: Signature:

if ($IP_COUNTRY_FROM_SCRIPT_COUNTRY_DETECTOR == $IP_FROM_MY_USERS_DATABASE){echo "FKNG_FLAG"}

s820brx7 #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

Guest #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!

amylee Principal · 1,092 posts #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!

or download a geoip database google hard enough and you will find some

Guest #34

is it wml? i need wml...

learner Lead · 587 posts #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!!

BEST MOBILE ADVERTISER

External image (may be gone)

ori Lead · 512 posts #37

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?

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

SpiderWap Lead · 622 posts #38

I'm trying to work my own code out, if i get anything right i'll post, but my plan will just have to work...

In a guys profile his phone and ip shows right?

I'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.....

Guest #40

bro wht did u just ask to change? ip(0) where?

See this post maby it helping you out

ip2country post

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close