Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Getting Longitude and Latitude

  1. #1
    Join Date
    Jul 2012
    Posts
    197
    Thanks
    54
    Thanked 3 Times in 3 Posts

    Default Getting Longitude and Latitude

    Normally we get/browser/ operating system some more details of our site user, from back end of website by calling a simple coding in php.
    My Qs is, Is there any way to get the longitude and latitude of a visitor of our site in php ?
    Last edited by letom; 05-16-2013 at 07:13 AM.
    You will know the truth, and the truth will set you free (John 8:32)(The truth is about the only begotten son of GOD.....When you feel you are alone for facing your problems, God will never leave you by your own You are important for God

  2. #2
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    Mod's note:
    this type of generic, open-ended question does not usually generate good discussions, either because the question is too broad, there is no clear answer, or the answers are too subjective.

    It would probably be more productive for you to do some research (Google is your friend!), and then come back here if you find a specific question to ask.

    Because this type of discussion is often unproductive and may attract spam, this thread may be closed or deleted later.

  3. #3
    Join Date
    Jul 2012
    Posts
    197
    Thanks
    54
    Thanked 3 Times in 3 Posts

    Default

    TKS ....
    Yes This is wide, but experts can give a solution to certain extent.
    If it not feasible to answer the question.. terminate the thread now, i will consult to other forums which gives valuable information about this common topic.
    You will know the truth, and the truth will set you free (John 8:32)(The truth is about the only begotten son of GOD.....When you feel you are alone for facing your problems, God will never leave you by your own You are important for God

  4. #4
    Join Date
    Mar 2011
    Location
    N 11░ 19' 0.0012 E 142░ 15' 0
    Posts
    1,530
    Thanks
    41
    Thanked 89 Times in 88 Posts
    Blog Entries
    3

    Default

    Quote Originally Posted by letom View Post
    My Qs is, Is there any way to get the longitude and latitude of a visitor of our site in php ?
    There is no built in easy way, but there are services that provide that functionality. Read (http://php.net/manual/en/function.ge...rd-by-name.php)
    (uses GeoIP - http://php.net/manual/en/book.geoip.php)
    HOWEVER, you won't be getting the user's latitude and longitude, it'll be their ISP (Internet Service Provider).
    Probably can tell you the area they're in, but not their exact location.
    As well as this, the data isn't 100% accurate.

  5. The Following User Says Thank You to keyboard For This Useful Post:

    letom (05-16-2013)

  6. #5
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    In PHP alone, no. But with a database that lists geographic locations for IPs, yes. You'll need something third party.

    GeoIP (as in keyboard's post) is a reasonable option (although there are a few others). I don't think it comes automatically installed in PHP, so you have to add it. Or you can add it manually, along with the PHP functions they supply. It comes either as a database or an organized (and efficient) flat file.

    Note that the free version is a little less accurate than the paid version, but both work well.


    However, I agree with traq here: you can find a lot of information by using Google. There are some new technologies such as for mobile devices that will give you more accurate information, in different ways.

    And not only Google, but also please search for old threads here. We've discussed this (and GeoIP) a number of times on the forum. If it has already been asked and answered, please read that first. Effective searching can save you (and us) a lot of time.
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  7. #6
    Join Date
    Jul 2012
    Posts
    197
    Thanks
    54
    Thanked 3 Times in 3 Posts

    Default

    Quote Originally Posted by keyboard1333 View Post
    There is no built in easy way, but there are services that provide that functionality. Read (http://php.net/manual/en/function.ge...rd-by-name.php)
    (uses GeoIP - http://php.net/manual/en/book.geoip.php)
    HOWEVER, you won't be getting the user's latitude and longitude, it'll be their ISP (Internet Service Provider).
    Probably can tell you the area they're in, but not their exact location.
    As well as this, the data isn't 100% accurate.
    Thanks for your information, Yes I know the information you provided, and know it is not 100% accurate, [I]Previously i had practically tested it to a certain extent..but totally meaning less ... then this ip is sufficient to trace the user details, or any other we want to collect for our future reference if any, other than ip..
    Last edited by letom; 05-16-2013 at 11:02 AM.
    You will know the truth, and the truth will set you free (John 8:32)(The truth is about the only begotten son of GOD.....When you feel you are alone for facing your problems, God will never leave you by your own You are important for God

  8. #7
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    Quote Originally Posted by letom View Post
    ... then this ip is sufficient to trace the user details, or any other we want to collect for our future reference
    It will depend on what details you want to track, but generally, no - since many people have dynamic IP addresses, there's no way to be sure their IP (or their ISP's IP) will be the same from one request to the next.

    Things that would be useful to know about your question:

    ...what "details" do you want to track?
    ...why do you want to know the user's lat/long?

  9. #8
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    There are lots of things you can approximate. There's basically nothing that you can know with 100% certainty.
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  10. #9
    Join Date
    Jul 2012
    Posts
    197
    Thanks
    54
    Thanked 3 Times in 3 Posts

    Default

    Quote Originally Posted by traq View Post
    It will depend on what details you want to track, but generally, no - since many people have dynamic IP addresses, there's no way to be sure their IP (or their ISP's IP) will be the same from one request to the next.

    Things that would be useful to know about your question:

    ...what "details" do you want to track?
    ...why do you want to know the user's lat/long?
    Thanks...
    ...what "details" do you want to track?
    Asking a Question "what "details" do you want to track?" for my Question "ip is sufficient to trace the user details ?, or any other we want to collect for our future reference if any, other than ip.."" .. is meaning less, i have nothing to do with that.

    why do you want to know the user's lat/long?
    When some unknown person is getting into my home as a visitor, i will ask the details, where he come from/what purpose/where he is staying ? not only me but all people will ask...FYI, Your Question is not the main subject of this thread, / but if you ask that type of Questions i need to talk beyond the subject
    Last edited by letom; 05-17-2013 at 06:03 AM.
    You will know the truth, and the truth will set you free (John 8:32)(The truth is about the only begotten son of GOD.....When you feel you are alone for facing your problems, God will never leave you by your own You are important for God

  11. #10
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    Quote Originally Posted by letom
    Asking a Question "what "details" do you want to track?" for my Question "ip is sufficient to trace the user details ?, or any other we want to collect for our future reference if any, other than ip.."" .. is meaning less, i have nothing to do with that.
    In some cases, the user's IP address will be sufficient to achieve your goals; in others, it will not. I asked you about this to help give a useful answer to your question.

    Quote Originally Posted by letom
    ...which are the details normally we require to track a visitor ?
    ...was the only actual "question" from your original post. What "details" you decide to track is determined directly by what you intend to do with them: are you trying to get usage statistics? serve different content based on region/language? improve security? build a marketing profile? All of these things would require tracking different information about your users (and different legal precautions, as well).

    Quote Originally Posted by letom
    When some unknown person is getting into my home as a visitor, i will ask the details, where he come from/what purpose/where he is staying ? not only me but all people will ask...
    Your website is a bit different than your house.

    To be clear, however, I am not asking you to justify your decision; nor am I suggesting that there is any need to. I am asking what you are trying to accomplish, again, so I might answer the question you asked.

    Quote Originally Posted by letom
    FYI, Your Question is not the main subject of this thread, / but if you ask that type of Questions i need to talk beyond the subject
    No, my questions are not the subject of your thread. Your question is. That is the question that I am trying to discover more about; to try and understand your . Discussing such things is not "beyond the subject."

    If you do not wish to provide any further details, that is, of course, up to you. However, I cannot "guess" what solution would work best for an unknown problem.

    "GeoIP" is something of a broad answer to a broad question, and if it's enough to get you started, that's great. If not, you'll need to let us in on the problem a bit more.
    Last edited by traq; 05-18-2013 at 05:07 AM.

Bookmarks

Posting Permissions

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