I have this: A javascript file that does a request to a php file.
I have two variables called Lat and Lng in my javascript. When I do the request to the php file with ajax I would like those two variables to be translated in to php values that the php file will use.
I hope this explains it clear enough. How can I do this?
Code: Javascript
var lng = center.lng();
var lat = center.lat();
$.ajax({
url: "ajax.php"
}).done(function(data){};
Code: Php
$lat = '';
$lng = '';
What I want is those two variable values from the Javascript in the php with each request.
If it helps to know what I'm doing exactly: I'm getting the longtitude and latitude from the google maps center. These values I want to use in the file_get_contents url in my php. Every time the request happens the url gets dynamic because the values will be send with the request.