Jay
Jay

Reputation: 443

Access users lat/lng from GeoLocation within PHP variable

I am using PHP/MySQL to return store locaitons based on distance from a give lat/lng.

I am currently using a hard coded lat/lng location but I would like to store a users Location either by Browser Geolocation or a geocoded text box or something.

is it possible to use HTML5 GeoLocation and then access the lat/lng as PHP variables so that I can pass them to MySQL? I have my php/mysql working, I am just not sure how to grab the users location

Upvotes: 0

Views: 738

Answers (1)

ABC
ABC

Reputation: 718

You will need to use ajax to pass the data to php.

You can look at jQuery's ajax library: http://api.jquery.com/jQuery.ajax/

Or at a ajax tutorial: http://www.w3schools.com/ajax/default.asp

Upvotes: 1

Related Questions