-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdelete2.php
More file actions
67 lines (49 loc) · 1.45 KB
/
Copy pathdelete2.php
File metadata and controls
67 lines (49 loc) · 1.45 KB
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
<?php
require ('php_not/connections/php_not_and_announ.php');
error_reporting(0);
if($_POST['delete1'])
{
$val=$_POST['text1'];
mysql_select_db($database,$php_not_and_announ);
$qur2="select branch from notices where name='$val' and belong=1";
$res2=mysql_query($qur2);
$qur1="delete from notices where name='$val' and belong=1";
$res1=mysql_query($qur1);
if($res1)
{
$file_del="php_not/upload/notices/".$res2."/".$val;
echo $file_del;
unlink($file_del);
}
echo '<script language="javascript">';
echo 'alert("File deleted.");';
echo 'window.location.href="del_not1.php";';
echo '</script>';
}
if($_POST['delete2'])
{
$val=$_POST['text2'];
mysql_select_db($database,$php_not_and_announ);
$qur3="select cid from notices where name='$val' and belong=0";
$res3=mysql_query($qur3);
$row3=mysql_fetch_array($res3);
$year=$row3['cid'];
$qur2="select branch from notices where name='$val' and belong=0";
$res2=mysql_query($qur2);
$branch=mysql_fetch_array($res2);
$branch1=$branch['branch'];
$qur1="delete from notices where name='$val' and belong=0";
$res1=mysql_query($qur1);
if($res1)
{
$name1 = preg_replace('/\s+/', '', $val);
$file_del="php_not/upload/notes/".$branch1."/".$year."/".$name1;
echo $file_del;
unlink($file_del);
}
echo '<script language="javascript">';
echo 'alert("File deleted.");';
echo 'window.location.href="del_not1.php";';
echo '</script>';
}
?>