-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeletePoint.php
More file actions
28 lines (21 loc) · 901 Bytes
/
Copy pathdeletePoint.php
File metadata and controls
28 lines (21 loc) · 901 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
<?php
if(isset($_POST['lat'])){
$username = $_POST['username'];
$password = $_POST['password'];
$lat = $_POST['lat'];
echo($lat);
$long = $_POST['long'];
$link = mysqli_connect('localhost:8000', $username, $password, 'eve');
mysqli_multi_query($link, 'SELECT * FROM points WHERE Latitude=' . $_POST['lat'].'AND Longitude ='. $_POST['long']);
$result = mysqli_use_result($link);
$row = mysqli_fetch_row($result);
if(strpos($row[5], ".png") || strpos($row[5], ".mp4") || strpos($row[5], ".f4v")){
unlink(substr($row[5], strrpos($row[5], "/") + 1));
}
mysqli_close($link);
$link = mysqli_connect("localhost:8000", "level3user", "level3", "eve");
mysqli_multi_query($link, 'DELETE FROM points WHERE WHERE Latitude=' . $_POST['lat'].'AND Longitude ='. $_POST['long']);
mysqli_close($link);
header("LOCATION: readSQLTable.php");
}
?>