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 ?
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 06: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
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.
Adrian ~ facebook | gist/github
['66.215.156.37','208.75.149.97'] // ip,ip array!
"Take that sticker *off* your hat; you look stupid" --Wil Wheaton
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
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.
letom (05-16-2013)
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>| Deutsch | italiano | español | português | català | un peu de français | Ninasoma Kiswahili | 日本語の学生でした。| درست العربية
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 10: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
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?
Adrian ~ facebook | gist/github
['66.215.156.37','208.75.149.97'] // ip,ip array!
"Take that sticker *off* your hat; you look stupid" --Wil Wheaton
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>| Deutsch | italiano | español | português | català | un peu de français | Ninasoma Kiswahili | 日本語の学生でした。| درست العربية
Thanks...
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....what "details" do you want to track?
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 subjectwhy do you want to know the user's lat/long?
Last edited by letom; 05-17-2013 at 05: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
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.Originally Posted by letom
...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).Originally Posted by letom
Your website is a bit different than your house.Originally Posted by letom
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.
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."Originally Posted by letom
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 04:07 AM.
Adrian ~ facebook | gist/github
['66.215.156.37','208.75.149.97'] // ip,ip array!
"Take that sticker *off* your hat; you look stupid" --Wil Wheaton
Bookmarks