![]() |
|
#1
|
|||
|
|||
Get countryHi,
I want to make a statistics page that will display from which country people come. Something like this: ----------------------- USA: 15 visitors UK: 45 visitors ... ... .... Brazil: 70 visitors etc etc ------------------------- I have the layout (it is cool ) My question: What is the best way to get something like this??? I curently use ---> $lang=$_SERVER["HTTP_ACCEPT_LANGUAGE"]; it works ok with explorer but when i try with firebird or Oper... a nothing i thought of doing something like this: if(eregi("country code here",$agent)) { do something; } but it seems that i will have 40 if statements How can i make this shorter??? Any help??? |
|
#2
|
||||
|
||||
suggest: using a IP to Country databaseQuote:
I had a great script done exactly for this, unfortunately I lost it ALL when my Linux setup failed on me a few months back... When I wrote that script I used a database, you can find a couple here: http://www.gidforums.com/t-1325.html. If this is not an option for you, I will think about your idea above and see what I can add later on.. __________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
|
#3
|
|||
|
|||
|
Sometimes life is nice to me
I found a function at Evilwalrus's site: http://www.evilwalrus.com/viewcode.php?codeEx=529 it is great it does what you suggested me. Thanks for your info ![]() |
|
#4
|
|||
|
|||
|
Hi there,
looked at script, for up to date ip detection check out this free database I saw mentioned on php.net http://ip-to-country.webhosting.info/ Junk Ked Last edited by JUNK KED : 07-Mar-2004 at 22:29.
Reason: Spelling mistakes, remove quote
|
Recent GIDBlog
More photos on Flickr by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| tracking city and country from IP address | s786787 | Web Design Forum | 5 | 06-Nov-2003 23:23 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The