-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsavePoints.php
30 lines (23 loc) · 1012 Bytes
/
savePoints.php
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
<?php
include_once 'includes/dbh.inc';
$conn = new mysqli($dbServername, $dbUsername, $dbPassword, $dbName); // Create connection
if ($conn->connect_error) { // Check connection
die("Connection failed: " . $conn->connect_error);
}
echo "Connected successfully";
$name = mysqli_real_escape_string($conn, $_POST['NAME']);
$latitude = mysqli_real_escape_string($conn, $_POST['LATITUDE']);
$longitude = mysqli_real_escape_string($conn, $_POST['LONGITUDE']);
$type = mysqli_real_escape_string($conn, $_POST['TYPE']);
$reason = mysqli_real_escape_string($conn, $_POST['REASON']);
$improvement = mysqli_real_escape_string($conn, $_POST['IMPROVEMENT']);
if (strlen($times) > 200000) { $times = ""; }
$sql = "INSERT INTO geoData (NAME,LATITUDE,LONGITUDE,TYPE,REASON,IMPROVEMENT)
VALUES ('$name', '$latitude', '$longitude', '$type', '$reason', '$improvement')";
if ($conn->query($sql) === TRUE) {
echo "Page saved!";
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
$conn->close();
?>