-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpurc_delete.php
45 lines (41 loc) · 1.05 KB
/
purc_delete.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
session_start() ;
//--- if user is not logined, redirect to index.php
if (!isset($_SESSION["userid"])){
header("location:./index.php") ;
return ;
}
//---
include 'utility_dbinfo.php';
?>
<!DOCTYPE html>
<html>
<body>
<div style="width: 100% ; height: 100px ; float: center">
<?php include 'utility_menu.php';?>
</div>
<div style="width: 100% ; height: 100px ; float: center">
<?php
//--- Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Databases connection failed: " . $conn->connect_error);
}
//---
$sql = "DELETE FROM poh WHERE purc_no = '".$_GET["id"]."'";
if ($conn->query($sql) === TRUE){
$conn->close();
//---
header("location:./purc_gridView.php") ;
}
else{
echo "Error: " . $sql . "<br>" . $conn->error."<br>".
"<a href='./purc_gridView.php'>Go back</a>" ;
//---
$conn->close();
}
?>
</div>
</body>
</html>