Go4Expert

Go4Expert (http://www.go4expert.com/)
-   PHP (http://www.go4expert.com/articles/php-tutorials/)
-   -   Getting Visitor's Country with PHP using Geo IP (http://www.go4expert.com/articles/getting-visitors-country-php-using-geo-t3511/)

Bhullarz 27Sep2007 16:56

Re: Getting Visitor's Country with PHP using Geo IP
 
Sir, this site is providing 7mb CSV file to import into SQL database which is again more than 500KBs. So problem remains the same.Web-Host will not allow to upload file size more than 500KBs.

shabbir 27Sep2007 17:10

Re: Getting Visitor's Country with PHP using Geo IP
 
Quote:

Originally Posted by Bhullarz
Sir, this site is providing 7mb CSV file to import into SQL database which is again more than 500KBs. So problem remains the same.Web-Host will not allow to upload file size more than 500KBs.

There are 2 options available to you.

1. Switch the webhost
2. Manually get that csv file into small small csv files and upload into the database.

arround 13Jun2008 15:56

Re: Getting Visitor's Country with PHP using Geo IP
 
hello, I apologize for posting after a year of inactivity in this thread but I really need some help.

In the past 4 days I've been looking for a solution to filter traffic on my website acording to my users country.

I saw this post and it seams perfect for my problem but sincerely I don't know where to start from.

I follow the steps:

1. "To use it, you'll have to first download the GeoIP Free Country file and extract it into a directory in your Web server." - what should I download? I've downloaded a csv file and a geoip.dat file but I can't see any geoip.inc ....


All I want is to allow onlu spanish IPs in my spain.php file ... Is that possible?

Thank you

pradeep 13Jun2008 16:03

Re: Getting Visitor's Country with PHP using Geo IP
 
Yes, that's possible, I guess you'll need to use the FilesMatch directive.

arround 13Jun2008 17:22

Re: Getting Visitor's Country with PHP using Geo IP
 
pradeep, I'll pay you 30$-$40 if you can do it for me because I have no idea

I have a shared hosting and my intention is to block all traffic except spain for spain.php and the same with france.php, us.php, etc. I would like (in the end) only to add some text/code in pages like spain.php so that I can do it myself when adding new pages (new countries)

Can you do the job ?

pradeep 13Jun2008 21:27

Re: Getting Visitor's Country with PHP using Geo IP
 
Yes I can do it, do you have GeoIP installed??

Blagoj 19Oct2008 02:24

Re: Getting Visitor's Country with PHP using Geo IP
 
Try this free PHP class (importer for the csv file included) for GeoLite country database:
http://phpweby.com/software/ip2country

gkumar 30Jun2009 15:19

Re: Getting Visitor's Country with PHP using Geo IP
 
By Philip Miseldine:-While the Internet is a global phenomenon that connects different people in different countries, many sites fail to target their content or functionality to visitors who speak languages other than English, or who live outside countries with the largest Internet user bases, like America. But, with nations like China using the Internet more and more, English-only is no longer a smart decision.

It's time to get smart. If you think that providing your site in another language will be a huge hassle, think again.

GeoIP API, combined with your .NET Web applications, can create pages whose content is specifically tailored to the user on the basis of their geographical location -- this article will show how it's done. By the time we've finished, you'll be able to use GeoIP API and .NET to increase visitor satisfaction and, potentially, ad revenues for your site.
GeoIP:-GeoIP is a product from MaxMind that maps given IP addresses to specific locations stored in a database of IP addresses.

Different editions of GeoIP are available, but you can use the free edition of the country database to get 93% accurate mappings within your applications. Do check the licensing information to make sure your particular app is suitable for the free use option.

MaxMind also provide a C# API, which we'll use in this article. You need to download both the API and the free country database to be able to use the code in this article:

* Download the API here
* . Download the country database here.

rendra_mm2 16Jul2009 07:55

Re: Getting Visitor's Country with PHP using Geo IP
 
So Nice ...

rendra_mm2 16Jul2009 07:58

Re: Getting Visitor's Country with PHP using Geo IP
 
But,,, i can't download the CSV file yet ... :(


All times are GMT +5.5. The time now is 16:45.