a nice photo of my face :D

IP2Country converter class



What's new?    

Small and big flags are added

  1. Short description
  2. License
  3. Download
  4. Version history
  5. Related work
  6. To do
  7. Credits
  8. Contact

Description ( Top )
With this class you can figure out from which country your visitor comes. It takes the IP address of the client's, converts it to hostname, then it checks end of the hostname. Sometimes the hostname cannot be resolved, thus the country cannot be determined either. This is not the fault of the script. Example: 193.6.138.45 => delfin.klte.hu => Hungary. Or with your data:

Client IP: 38.107.191.103
Client Hostname:
Client Country:
Client Flag:

License ( Top )
The stuff is released under GPL.

Download ( Top )
You can download the source and its components here. Under Windows use WinRAR to uncompress it.
View the source code online here. The country data file is here.

Version history ( Top )
Version Date Remark
v0.2 17 Sept, 2003 flags (in small and big sizes) are added
v0.1 29 May, 2003 first version is released

Related work ( Top )

Ideas / To do ( Top )
Adding a function that would return a link to the appropriate flag.

Credits ( Top )
I found this class about a year ago, but I don't remember where exactly. It was submitted by HADDADI Fabien (tropicalm@free.fr). Fabien used MySQL, but the database is so small that I put it to a plain text file. This way the class can be used anywhere. I also added some new functions to the class.
People who helped me: Shawn

How to contact me ( Top )
If you have any ideas how to improve this project, then send me your suggestions/patches to szathml@delfin.unideb.hu.


Created by Laszlo Szathmary, alias Jabba Laci, 2003