-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvb_cancel2.php
47 lines (36 loc) · 1.18 KB
/
vb_cancel2.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
<?php
session_start();
?>
<html>
<head><title>單字背誦王-刪除單字</title></head>
<body>
<?php
$file_name = $_SESSION['Id']."vbData.txt";
$fp = fopen($file_name,'wb');
$current_vb_count = 0;
$now_vb = $_SESSION['now_vb'];
if($now_vb[$_POST['update_vb']][3] != ""){
$wantTodelete = "upload/".$now_vb[$_POST['update_vb']][3];
unlink($wantTodelete);//將檔案刪除
}
unset($now_vb[$_POST['update_vb']]);
foreach($now_vb as $i => $content){
fwrite($fp,$content[0]."|".$content[1]."|".$content[2]."|".$content[3]."\n");
}
print "已刪除 1 個單字<br>";
unset($_SESSION['uploadedName']);
unset($_SESSION['img_ready']);
?>
<script>
function back_post(){
form_back.method="get";
form_back.action = "vb_cancel.php";
form_back.submit();
}
</script>
<form name="form_back">
<input type="hidden">
</form>
<script type="text/javascript"> setTimeout("back_post()",3000)</script>
</body>
</html>