Ok here's what I want:
I need something like a Javascript or PHP script to get a gps location from a visitor, and then secretly send it to me (I won't use this bad, it's for an website that prevents my iPhone from being stolen)
I want that if a thief opens the website (which I will webclip, name Safari and give the safari icon) I automatically get his location and he's redirected to google or something else
So basically like this:
navigator.geolocation.getCurrentPosition(GetLocation);
function GetLocation(location) {
//Some script that sends the location secretly to me
}
{
windows.location="http://google.com";
}
The ethical questions about accessing private location information without consent aside, browsers are explicitly designed not to inadvertently disclose this. This is why you'll be asked to grant access to an HTML 5 site attempting to gain access to the coordinates.
The best you could do is use a service which resolves the IP address to a physical location and makes some assumptions based on this, although the reliability of this practice is sporadic at best.