I am new to web technologies and I want to create a web app that allows a user to click on a map and a form will pop up and it will allow him to enter certain information. That information is saved on a database. Now I don't know how to pull that information because I need to create markers on the map with the longitude and latitude as its position. I don't know how to pass values from php variables to javascript
<?php
require_once("mysqli_connect.php");
$query = "SELECT * FROM markeri";
$response = @mysqli_query($dbc, $query);
if($response){
while($row = mysqli_fetch_array($response)){
$naziv = $row['naziv'];
$opis = $row['opis'];
$email = $row['email'];
$latitude = $row['latitude'];
$longitute = $row['longitute'];
}
}
?>
This is the code for pulling data from the database. Now I need to create markers on the map with all the information from the database.
var marker = L.marker(e.latlng);
marker.addTo(mymap).bindPopup(form).openPopup();
<div id="form">
</br>
Naziv:</br>
<h1 id="naziv"></h1></br></br>
Opis problema:</br>
<p id="opis"></p> </textarea></br>
E-mail:</br>
<h3 id="email"> </h3></br></br>
</div>
I am using the Leaflet API for interaction with the map. I need to create markers by replacing e.latlng(which is a JS array) with latitude and longitude pulled from the database with PHP and to make a marker at that position. I need to fill the information in the "form" above as well for each individual marker.
