PHP to obtain GPS information upon "Submit"

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
shauntdergrigorian
Forum Newbie
Posts: 2
Joined: Tue Mar 23, 2010 2:26 pm

PHP to obtain GPS information upon "Submit"

Post by shauntdergrigorian »

Is it possible to acquire GPS information (coordinates, location) of mobile devices through PHP? I'm looking to save locations of friends who submit information onto my php site (with their permission of course). Any suggestions?? I'm still relatively new to PHP so please be patient with me. Thanks a million
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: PHP to obtain GPS information upon "Submit"

Post by onion2k »

It's not possible with PHP, but it is with Javascript on a browser that has the geolocation features enabled (most smartphones do). I had a play with it some time ago and found it was pretty good. Have a look at the source of this page http://ooer.com/geo/ to see what I came up with.

Remember though, the user will always be asked if they want to share their location info. There's no way around that.
shauntdergrigorian
Forum Newbie
Posts: 2
Joined: Tue Mar 23, 2010 2:26 pm

Re: PHP to obtain GPS information upon "Submit"

Post by shauntdergrigorian »

Thank you so much for your reply. That's fine, I can use javascript. Is there a name for this feature? Thanks again, you've helped me significantly
Post Reply