Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I am developing a PHP website. My requirement is that when a visitor/user visits my website ; ie, on the home/index page I would like to list all registered users who belong to the same location as the website visitor's. For example if the visitor is from a city X in Kolkata, then list all other registered users from X. How can I implement this feature? Is there any PHP function or like that to find the geolocation. I tried HTML5 geolocation. But it didn't worked?
This problem can not be solved exactly in common case. Algorithm is that: use geoip database and client's IP-address to get approximate location. Then, using same geoip-database, select similar IP ranges and, finally, search through other users using selected IP ranges. But remember, that users in most cases are behind NAT's, so this solution will be approximate. But you can ask your users when they are registering - about their location. The method I've described before can be used either for registered and unregistered visitors.
Using any geolocation API will be most efficient for this requirement.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
On my site I have used fb login and I can do it easily for my site. But as we have users fb login id and other details, is it possible to generate facebook login time stamp for user for www.facebook.com.
Something like varifying how many times user performs facebook login and how many times he comes to my site.
or something nearer to this if possible
I don't fully understand what you want to do, if you just want a timestamp for when you receive the response from Facebook then you can just create one on your side of the code using time(). If you want to know anything about the user's login habits beyond you're site then that isn't possible due to privacy reasons I imagine.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 9 years ago.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Improve this question
I would like to create a web application that people can use for to locate them self with GPS tracking.
criteria:
I have to use my own map for a particular location
It is a web application that will work with all new generation browsers mainly for mobiles
and tablets
whenever I am moving one place to other the pointer should change the location according
the place in map.
is it possible to create in a web application?
With HTML5 you can do it, see this example Get user location within Google Map
To get updates for user location, you should implement watchPosition function in your JavaScript code too.
At first time, with getCurrentPosition function, you will get an aproximate user location, if you need more accuracy, you should implemente watchPosition
By calling this method as soon as your app starts, the GPS hardware will activate immediately and keep running, and it’ll fire callbacks whenever the device’s location has changed.
Read more here HTML5 Geolocation: Improving GPS Accuracy
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
Have been working on a project that requires you to get the geographical coordinates of the computer who is viewing the page. I want it using PHP. Please help me. Thanks in advance!
If you have the GeoIP extension installed you can use this:
$geodata = geoip_record_by_name($_SERVER['REMOTE_ADDR']);
$latitude = $geodata['latitude'];
$longitude = $geodata['longitude'];
http://www.php.net/manual/en/intro.geoip.php
Without having this installed or using a third party webservice this won't work, though.
You could get the IP adress with $_SERVER['REMOTE_ADDR'].
Then, there many applications which allow us to searching geolocalisation of a IP adress like google, or RESTful webservices for exemple.
Here is an example of RESTful webservice :
The request : freegeoip.net/{format}/{ip_or_hostname} ;
An example with Google : http://freegeoip.net/json/google.com
If you want more details : http://freegeoip.net/
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
i want to do if a person login from state A(this is his home town) and after 2 hours the same account login again by another state B. then ask a security Answer.
How i can check this. with the help of cookie or any thing else
You can't check for this. IP geolocation is not nearly accurate enough.
From my desk right now, I have 3 IP addresses. One in Illinois, another in Missouri (cell phone provider has registered their IPs there), and a proxy server on a VPS in Europe. In addition, it's common for addresses to change regularly.
Consider using two-factor authentication if you want to increase your security standards.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions must demonstrate a minimal understanding of the problem being solved. Tell us what you've tried to do, why it didn't work, and how it should work. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
What I'm trying to do is parse a data table from this link and similar links on the site.
Basically it shows the water levels in different parts of Ontario. I want to get the data table and make my own graph.
Can someone point me in a direction to do this?
Is it possible to do without PHP?
Target link
Is it possible to do without PHP? Absolutely!
I suggest using Yahoo! Query Language (YQL).
What is YQL?
The Yahoo! Query Language is an expressive SQL-like language that lets
you query, filter, and join data across Web services. With YQL, apps
run faster with fewer lines of code and a smaller network footprint.
-- YQL Homepage
Just take a look at YQL Console, there's some nice examples at the bottom of the right panel which titled by DATA TABLES.
Another thing that makes me feel is the awesome THE REST QUERY feature.
You can use this API to get access to the query result in XML or JSON format.
There's also a full documented user guide you can use to find your answers.
Just give it a try, and I promise you will ♥ that.