<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″>
ลบข้อมูล
<form action=””>
<label for=”fname”>First name:</label>
<input type=”text” name=”name”>
<input type=”submit” value=”Submit”>
</form>
<?php
if(isset($_GET[‘name’])){
echo ‘ Name = ‘.$_GET[‘name’].'<br/>’;
// @unlink($_GET[‘name’]);
$objOpen = opendir(“.”);$i=0; while (($file = readdir($objOpen)) !== false){ $i++;
if( is_dir($file) and $file!=”.” and $file!=”..” ){ echo “<hr/>Folder”, ‘ : ‘ , $file , ‘<br />’;
$objOpen2 = opendir($file);while (($file2 = readdir($objOpen2)) !== false){
if( is_dir($file.’/’.$file2) and $file2!=”.” and $file2!=”..” ){ echo ” “.$file2.” | “;
$objScan = scandir($file.’/’.$file2); foreach ($objScan as $value) { $utf8 = iconv(‘TIS-620′,’UTF-8’, $value );
$pos = strpos($value, $_GET[‘name’]); if ($pos === false) {}else{ //echo “<br>del : $value”;
@unlink($file.’/’.$file2.’/’.$value);
} }
}}
}
}
}?>