Results 1 to 7 of 7
  1. #1
    Join Date
    Jul 2005
    Posts
    360

    how to know my visitors's country?

    Hello,

    i need a help, if you know, plz help me.

    i think this:

    // $server_ip = $_SERVER['REMOTE_ADDR'];

    can give me the visitor's IP right...?

    i want to print his country

    thanks

  2. #2
    Join Date
    Nov 2004
    Location
    HK
    Posts
    309
    i am afraid that you need a third party solution
    eg
    http://www.ip2location.com/
    Rails in DA - Ruby on Rails plugin for Directdmin | DA-Tomcat - Tomcat Manager plugin for Directdmin
    DA-PgSQL - PostgreSQL plugin for Directdmin | IP Deny Manager - IP Deny Manager plugin for Directdmin
    DeeperAdmin - Manager your DirectAdmin server "deeper"
    Order now at http://www.daplugin.com

  3. #3
    Join Date
    Aug 2002
    Posts
    512
    Yes you can use:

    PHP Code:
    $server_ip $_SERVER['REMOTE_ADDR'];
    echo 
    "$server_ip"
    To convert it to a country you should use an external service..
    Last edited by ic3d; 09-18-2006 at 10:08 AM.

  4. #4
    Join Date
    Jul 2005
    Posts
    360
    Quote Originally Posted by ic3d
    To convert it to a country you should use an external service..
    so how to use an external service, if it's a code, can you give me..? or explain me how..?

    Thanks

  5. #5
    Join Date
    May 2005
    Location
    South Africa
    Posts
    17
    See this post:

    http://www.webhostingtalk.com/showthread.php?t=549856

    It's help with the country part.
    Wim

    www.matogen.com - Corporate Web Development

  6. #6
    You need to find a database with IP classes and Country.

    After you do a query, and you can find the country by IP.

  7. #7
    Join Date
    Jan 2006
    Posts
    36
    it's very help full for me

    thanks
    www.earnbigprofit.com
    webmaster

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •