Skip to content
Advertisement

Ajax PHP placing variables in string for API call

I have read and attempted to implement all solutions I found on the web but until now I can’t get this to work, so time to ask for help:

I send the following Ajax call to my PHP file:

JavaScript

this invokes the following call in the php file:

JavaScript

Everything works okay, but what I’d like to do next is replace the preformatted coords, with those that I send across in the ajax call. This is where I am failing, I have tried varying methods to inject lat and lon including logic from a prior project: $_REQUEST['lat'], nothing seems to work.

Can someone please advise what format I need to use?

many thanks

EDIT var_dump() output:

JavaScript

Advertisement

Answer

You can use $_POST['lat'] and $_POST['lon']

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement