I'm currently making a project for university and i'm trying to implement a google map on to my website
ReportStolenBike.js:
    var mapCenter = new google.maps.LatLng(51.8979988098144,-2.0838599205017);
var geocoder = new google.maps.Geocoder();
var infowindow = new google.maps.InfoWindow();
var myMap;
var marker;
function initialize(){
    var mapOptions = {
        zoom: 15,
        center: mapCenter
    };
    myMap = new google.maps.Map(document.getElementById("mapInput"), mapOptions);
    marker = new google.maps.Marker({
        map: myMap,
        position: mapCenter,
        draggable: true 
    });     
    function markerDragged() {
        var selectedPos = {'latLng': marker.getPosition()};
        geocoder.geocode(selectedPos, showAddressInInfoWindow);
    }        
    google.maps.event.addListener(marker, 'dragend', markerDragged);
    function showAddressInInfoWindow(results) {
        if (results[0]) {
            infowindow.setContent(results[0].formatted_address);
            infowindow.open(myMap, marker);
        }
    }         
}
google.maps.event.addDomListener(window, 'load', initialize);
$('#formReportStolen').on('submit', function(e) {
    var formData = new FormData(this);
    var lat = marker.getPosition().lat();
    var lng = marker.getPosition().lng();
    formData.append("lat", lat);
    formData.append("lng", lng);
    e.preventDefault();
    $.ajax({
        url: "PublicReportStolenDAO",
        method : "POST",
        data: formData,
        contentType: false,
        cache: false,
        processData: false,
        success:function(echoedMsg) {
            if (echoedMsg == "True") {
                alert("Successfully reported.");
            }
        }
    });
});
So in that java script class i'm displaying my google map and trying to take the users current position. My map has a popup that will show that my map is indeed referencing the latitude and longitude but when trying to store them in to my sql database, nothing is storing.
PublicReportStolenDAO.php
  <?php
function StolenReg(){
    $bikeID = $_POST['txtBikeID'];
    $date = $_POST['txtDateofTheft'];
    $lat = $_POST['lat'];
    $lng = $_POST['lng'];
    include "../../include/config.php";
        $verifyFuncBike = "SELECT email FROM `tbl_user` WHERE email = '$email'";
        $resultBike = mysqli_query($connection,$verifyFuncBike);
        $rowBike = mysqli_fetch_array($resultBike,MYSQLI_ASSOC);
        $countBike = mysqli_num_rows($resultBike);
        if($countBike == 1) {
            $sql = "INSERT INTO `tbl_stolen`(BikeID, Date, Lat, Lng)".
            " VALUES ".
            "('$bikeID', '$date', '$lat', '$lng')";
            if(mysqli_query($connection, $sql)) {
            echo "Report successfully sent, please return back to the site.";
                echo $lat;
                echo $lng;
            } else {
                echo mysqli_error($connection);
            }
        }else {
            echo "Error, please return back to the site and try again.";
        }
        mysqli_close($connection);
    } 
stolenReg();
?>
Sorry for the possibly awful code, im very new to web development
 
    