לש"ש
שיניתי במחיקה מ $file k $_GET['file']
ועוד משהוא קטן.:
PHP קוד:
echo "<center><b><u>List of the upload files:</u></b><br />\n";
if ($handle = opendir("../" . $upload_path)) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
echo $file . " (<a href=\"$PHP_SELF?d=upload&action=delete&file=$file\">Delete</a>)<br />\n";
}
}
closedir($handle);
}
else {
echo "<u>Error:</u> Cannot open uploads directory\n";
}
echo "</center>\n";
if($action == "delete" && $_GET['file']!='') {
unlink("../" . $upload_path . $_GET['file']);
}
וגם תוודא שבשורה הזו:
upload&action=delete&file=$file
המשתנה $file באמת מודפס ולא רק השם שלו.