dragonusthei Posted December 6, 2006 Share Posted December 6, 2006 Hello,How can i detect whitch country a user comes from?Thanks. Quote Link to comment Share on other sites More sharing options...
joquius Posted December 6, 2006 Share Posted December 6, 2006 There are many scripts on the net with IP directories. Search for them on Google. Quote Link to comment Share on other sites More sharing options...
dragonusthei Posted December 6, 2006 Author Share Posted December 6, 2006 But how would you do this on the fly?is there no simple way using http codes? Quote Link to comment Share on other sites More sharing options...
joquius Posted December 6, 2006 Share Posted December 6, 2006 There's no HTTP string which relates to your locale. You need to get an IP directory. Quote Link to comment Share on other sites More sharing options...
dragonusthei Posted December 6, 2006 Author Share Posted December 6, 2006 can you recommend any and is this gonna cost me? Quote Link to comment Share on other sites More sharing options...
joquius Posted December 6, 2006 Share Posted December 6, 2006 There are loads of free ones just "Search for them on Google." Quote Link to comment Share on other sites More sharing options...
SharkBait Posted December 6, 2006 Share Posted December 6, 2006 There are free databases. Look for Ip2Country they offer a database (cvs file) that you can use and do your queries against.You need to find the numeric representation of the customers IP address via a formula. I do it for my employer's website to show various product that is only legally allowed to use in their country.If you can find the ip2country database, I can look and post my code for looking up the area based on their IP. Quote Link to comment Share on other sites More sharing options...
dragonusthei Posted December 6, 2006 Author Share Posted December 6, 2006 Hi if you could post that it would be fantastic. Quote Link to comment Share on other sites More sharing options...
Orio Posted December 6, 2006 Share Posted December 6, 2006 Just google!Here's one I found by [b]Googling[/b]:http://www.brothersoft.com/web_author/site_management/maxmind_geolite_country_database_42917.htmlI am sure there are better ones out there... (it has lots of IPs, but it didnt have mine for an example)Orio. Quote Link to comment Share on other sites More sharing options...
dragonusthei Posted December 6, 2006 Author Share Posted December 6, 2006 Ok so i have a .cvs file how do i make that go into my database? Quote Link to comment Share on other sites More sharing options...
makeshift_theory Posted December 6, 2006 Share Posted December 6, 2006 I'm assuming your using a mysql database, if so then open up your database in phpmyadmin and click import then click import from csv. Or if if you want to do it from the command line:[code]LOAD DATA INFILE 'filename.csv' replace INTO TABLE {tablename} FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' (examplefield1,examplefield2,examplefield3);[/code]I belive that's right if I remember my SQL commands, someone correct me if I'm wrong, don't like giving bad info =). Quote Link to comment Share on other sites More sharing options...
dragonusthei Posted December 6, 2006 Author Share Posted December 6, 2006 there is no import button ........... Quote Link to comment Share on other sites More sharing options...
dragonusthei Posted December 7, 2006 Author Share Posted December 7, 2006 so do i just run that code in mysql? Quote Link to comment Share on other sites More sharing options...
Daniel0 Posted December 7, 2006 Share Posted December 7, 2006 Yes. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.