-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeleteTrip.php
More file actions
28 lines (25 loc) · 815 Bytes
/
Copy pathdeleteTrip.php
File metadata and controls
28 lines (25 loc) · 815 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
require_once 'config.php';
$id = $_REQUEST['id'];
$sql = "DELETE FROM takes_a WHERE trip_id = '".$id."'";
if(mysqli_query($link, $sql)){
$sql = "DELETE FROM travels_to WHERE trip_id = '".$id."'";
if (mysqli_query($link, $sql)){
$sql = "DELETE FROM Trip WHERE trip_id = '".$id."'";
if (mysqli_query($link, $sql)){
echo '<script>alert("Success, deleted your trip")</script>';
}
else{
echo '<script>alert("Error, could not delete your trip")</script>';
}
}
else{
echo '<script>alert("Error, could not delete your trip")</script>';
}
} else {
echo '<script>alert("Error, could not delete your trip")</script>';
}
$usrid = $_REQUEST['usrid'];
$url = "ViewTrips.php?usrid=".$usrid;
echo '<script>location.href="'.$url.'"</script>';
?>