-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathedit.php
More file actions
42 lines (40 loc) · 797 Bytes
/
edit.php
File metadata and controls
42 lines (40 loc) · 797 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
34
35
36
37
38
39
40
41
42
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<?php
$server = "localhost";
$user = "root";
$password = "ag97";
$db = "note";
$conn = new mysqli($server,$user,$password,$db);
$i = $_POST['id'];
$h = $_POST['heading'];
$e = $_POST['end'];
$c = $_POST['content'];
$s = $_POST['status'];
if (isset($_POST['changes'])) {
$query = "UPDATE note SET heading='$h' , end='$e' , content='$c' , status='$s' WHERE id='$i' ";
if($conn->query($query)){
echo "added";
header("refresh:0.1;url=note2.php");
}
else{
echo "no";
}
}
else{
$query = "DELETE FROM note where id='$i' ";
if($conn->query($query)){
echo "deleted";
header("refresh:0.1;url=note2.php");
}
else{
echo "no";
}
}
?>
</body>
</html>