-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathd_user.php
70 lines (68 loc) · 1.65 KB
/
d_user.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
<?php
include_once 'include/admin_header.php';
$fat="select * from register";
$r=mysqli_query($con,$fat);
?>
<?php
if (isset($_POST['delete']))
{
$email=@$_POST['select_email'];
$q= "select * from register where email='$email'";
$up=mysqli_query($con,$q);
$p=mysqli_fetch_assoc($up);
$n=$p['img'];
// echo "$n";
if (@unlink("../profile/".$n)) {
$del="DELETE FROM `register` WHERE email='$email'";
if(mysqli_query($con,$del))
{
echo '<script>alert("User Deleted Successfully.");</script>';
}
else
{
echo '<script>alert("Error in user Deleting.");</script>';
}
}
else{
$del="DELETE FROM `register` WHERE email='$email'";
if(mysqli_query($con,$del))
{
echo '<script>alert("User Deleted Successfully.");</script>';
}
else
{
echo '<script>alert("Error in user Deleting.");</script>';
}
}
}
?>
<form action="d_user.php" method="POST">
<center> <table class="shad t_font" width="50%">
<th class="bk_t" colspan="2">
You can Delete User from user
</th>
<tr class="d_u_w">
<td>
<p class="justy mar"> Select User Email ID</p>
<select class="r_i b_spc" name="select_email">
<option selected disabled>Select here... </option>
<?php while ($res=mysqli_fetch_assoc($r))
{?>
<option value="<?php echo $res['email']; ?>" name="select_email"><?php echo $res['email']; ?>
</option>
<?php
}?>
</select>
</td>
</tr>
<tr>
<td>
<input type="submit" name="delete" value="Delete" class="btn mar"><br><br>
<a href="user.php" class="a"><input type="button" class="btn3 mar" value="Back"></a>
</td>
</tr>
</table> </center>
</form>
<?php
include_once 'include/a_footer.php';
?>