I can't really figure out this problem , let's say that on the page there is a form with one input in it , if you submit the form then the text that you save will be sent to the database and stored now , i would like to get user location:
Longitude Latitude
whenever he submits the form , now I found that it's better to get the location using Javascript and then send it to the server using AJAX so basically when i submit the form the text of input is stored in the database and , I marked the submit button with id "submit" and I want to use ajax with jquery so:
$.ajax({
url:'update_the_last_form_submit_data.php',
type:'POST',
data:{lat:lat,lat:lat}
success:,
error:
});
so what i want to do is , when ever the user submits the form , ajax will add the current longitude and latitude to the MySQL query which is being sent to database
and finally the table will look like this :
Time------------User Input--------Latitude---------Longitude
xx-xx-xx--------What you tiped----Detected longitude-------detected latitude
edit:
I don't know how do i do it
basically i have a click function with the ajax code but I don't know when i send the ajax request how do i know which row is the one that was just sent by me to php
$("#submit").click(function(){
$.ajax({
url:'update_the_last_form_submit_data.php',
type:'POST',
data:{lat:lat,lat:lat}
success:,
error:
});
});