So i have this code(JavaScript) and the webpage i am creating is with google maps api. This is the code:
var myLatLng;
for(var i = 0; i < locationLatLang.length; i++) {
myLatLng = new google.maps.LatLng({lat: parseFloat(locationLatLang[i][1]), lng: parseFloat(locationLatLang[i][2])});
if(google.maps.geometry.poly.containsLocation(myLatLng, polyLine[index]) || google.maps.geometry.poly.isLocationOnEdge(myLatLng, polyLine[index], 0.000000)){
console.log('True' + ' - ' + myLatLng.lat() + ' = ' + myLatLng.lng());
<?php
include 'update_graph.php';
?>
}
}
My question is, whenever i put include 'update_graph.php';
it does not show anything on the page, just a blank page. nothing appears. But when i remove that, it loads the page and shows everything. Is there a way i could get this to work. or is it not possible to require
or include
a php file
in javascript to query a database?