-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinsert_marker.php
More file actions
33 lines (26 loc) · 874 Bytes
/
insert_marker.php
File metadata and controls
33 lines (26 loc) · 874 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
$server = "localhost";
$user = "root";
$password = "";
$database = "LSProject";
$conn=mysqli_connect($server, $user, $password) or die(mysqli_error());
mysqli_select_db($conn, $database);
$name = $_POST["name"];
$latitude = floatval($_POST["latitude"]);
$longitude = floatval($_POST["longitude"]);
$dimensions = (int)$_POST["dimensions"];
$color = $_POST["color"];
$sql_insert="INSERT INTO markers (name, latitude, longitude, dimensions, color) VALUES ('".$name."', '".$latitude."', '".$longitude."', '".$dimensions."', '".$color."')";
$retval = mysqli_query($conn, $sql_insert);
if(!$retval) {
die('Could not insert data: ' . mysqli_error());
}
?>
<html>
<body>
<form action="locatii.php" id="form" name="form"></form>
<script type="text/javascript">
document.forms["form"].submit();
</script>
</body>
</html>