Your insert data script is running on GET requests, resulting in empty lines because there is nothing in $_POST. Place a line at the beginning of the PHP segment to exit if the request type is not POST.
I've no idea for geocoding other than there is probably a third party API you could use to get the data by script.