I have implemented the Google Maps API into my website to get the current location of the user. The code I have used is the one provided by Google:
http://ift.tt/2amvwps
To save the user's current location and display it in a text field, I need to insert the latitude and longitude values into MYSQL database for future use, and somehow get the location name. However, I am only aware of using PHP to insert the values as follows:
1. Create the query: $query = INSERT INTO '<table name>' VALUES...
2. mysqli_query($link, $query);
Since PHP is a server-side language, I reckon it can not be used within Javascript to access my database. Is there a better way to achieve this? Notice the latitude/longitude values are given by: position.coords.latitude/longitude
Any help would be appreciated.
Aucun commentaire:
Enregistrer un commentaire