-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdelete.php
87 lines (74 loc) · 1.87 KB
/
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<html>
<head>
<style>
.delet {
width: 30%;
height: 20%;
float: right;
margin-right: 26%;
margin-top: 10%;
}
</style>
<link href="css/style.css" type="text/css" rel="stylesheet"/>
</head>
<body class="body">
<?php
include('databasedadi.php');
//include('headerdadi.php');
//echo '<div class="zaminehabi">';
//include('rightmenu.php');
?>
<?php
$error = '';
$q = '';
if ($_SERVER['REQUEST_METHOD'] == "POST") {
$groupId = $_GET['id'];
$s = $_POST['edit'];
if ($s == null) {
$error = "لطفا فیلد را پر نمایید";
} else {
$mn = $_POST['edit'];
$query = "delete from groups where id=" . $groupId . "";
$result2 = runDelete($query);
header("location:manage.php");
}
}
?>
<form method="post" name="mariform">
<div class="delet">
<table border="1">
<tr>
<td>عنوان خبر</td>
<td>
<?php
$vm = $_GET['id'];
$qr = "select name from groups where id=" . $vm . "";
$result1 = runSelect($qr);
while ($row = $result1->fetch(PDO::FETCH_ASSOC)) {
$m = $row['name'];
echo "<input type='text' name='edit' value='$m'>";
}
?>
</td>
<?php
echo "<td>" . "$error" . "</td>";
?>
</tr>
<tr>
<td></td>
<td></td>
<td>
<?php
echo "<input type='submit' name='sub' value='حذف'>";
?>
</td>
</tr>
</table>
</div>
</form>
<?php
//include('leftmenu.php');
echo '</div>';
?>
</body>
</html>