GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 22-Jan-2004, 15:00
basdog22 basdog22 is offline
New Member
 
Join Date: Jan 2004
Posts: 14
basdog22 is on a distinguished road

Get country


Hi,
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  
Old 22-Jan-2004, 15:39
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough

suggest: using a IP to Country database


Quote:
Originally Posted by basdog22
My question:
What is the best way to get something like this???

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..
  #3  
Old 22-Jan-2004, 15:52
basdog22 basdog22 is offline
New Member
 
Join Date: Jan 2004
Posts: 14
basdog22 is on a distinguished road
Talking

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  
Old 07-Mar-2004, 23:27
JUNK KED JUNK KED is offline
Awaiting Email Confirmation
 
Join Date: Oct 2003
Location: uk&ireland
Posts: 85
JUNK KED will become famous soon enough
Hi there,
looked at script, for up to date ip detection check out this free database I saw mentioned on php.net

ip-to-country.webhosting.info

Junk Ked
Last edited by JUNK KED : 07-Mar-2004 at 23:29. Reason: Spelling mistakes, remove quote
 
 

Recent GIDBlogProblems with the Navy (Chiefs) by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
tracking city and country from IP address s786787 Web Design Forum 5 07-Nov-2003 00:23

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 10:34.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.