-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdels.php
More file actions
47 lines (47 loc) · 1.07 KB
/
dels.php
File metadata and controls
47 lines (47 loc) · 1.07 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
<?
include"config.php";
$del=$_REQUEST[del];
$id=$_REQUEST[id];
$nid=$_REQUEST[nid];
switch($del)
{case entry :
$datablog="./content/art.txt";
$record = file($datablog);
$jmlrec = count($record);
for ($i=0; $i<$jmlrec; $i++) {
$row = explode("|",$record[$i]);
if ($id==$row[0]) {
$record[$i] = "";}}
$update_data = fopen($datablog,"w");
for ($j=0; $j<$jmlrec; $j++)
{if($record[$j] <> "")
fputs($update_data,$record[$j]);}
fclose($update_data);
unlink("./content/kom_$id.txt");
header("location:./");
break;
case koment :
$datakom="./content/kom_$nid.txt";
$record = file($datakom);
$jmlrec = count($record);
for ($i=0; $i<$jmlrec; $i++) {
$row = explode("|",$record[$i]);
if ($id==$row[0]) {
$record[$i] = "";}}
$update_data = fopen($datakom,"w");
for ($j=0; $j<$jmlrec; $j++)
{if($record[$j] <> "")
fputs($update_data,$record[$j]);}
fclose($update_data);
header("location:./art.php?id=$nid");
break;
case allkom :
$dell=fopen("./content/kom_$id.txt","w+");
header("location:./art.php?id=$id");
break;
case allnews :
$dell=fopen("./content/entry.txt","w+");
header("location:./");
break;
}
?>