Reputation: 10579
I am building a PHP&MySQL website. I managed to successfully use the Google Places API on the client side of my website (using JavaScript). I am passing the formatted_address (chosen by the user via the Google Places API) to the PHP script.
The trouble is, I haven't got a clue how I can validate on the server side whether or not the input is genuinely a Google Places API result, or it has been tampered with prior to submission.
I have scoured the web looking for a basic tutorial of how to use the Google Places API via to PHP to no avail.
Any ideas?
Thanks.
Upvotes: 1
Views: 134
Reputation: 86
The only way I guess you can do that is call the google Places Api with the same input the user had given and retrieve the JSON/xml Result and check it with your form Submission,but that would be an additional request on your api key.
Usually the best practice to do this will be sending these critical data from the server to the client via JSON. I suggest you try that, this method is tedious.
Upvotes: 1