skrypt:
<?php function dirList ($directory) { // create an array to hold directory list // create a handler for the directory // keep going until all files in directory have been read // if $file isn't this directory or its parent, // add it to the results array $results[] = $file; } // tidy up: close the handler // done! return $results; } header('Content-type: text/html; charset=utf-8'); //musi byc bo rozne serwery sa z roznym kodowaniem //<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> $html = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">'; $html .= '<html>'; $html .= '<head>'; $html .= '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">'; $html .= '<title>'; $html .= "Pliki"; $html .= '</title>'; $html .= '</head>'; $html .= '<body>'; $html .= "<div>"; $aDir = "./myfiles"; $files = dirList($aDir); { $file = $aDir."/".$_GET["deleteFile"]; if ($file == $_SERVER["SCRIPT_NAME"]) { $html .= "Nie mozna usunac tego pliku<br>"; } { $html .= "Usunieto $file<br>"; } else { $html .= "Blad podczas usuwania pliku $file<br>"; } } foreach ($files as $val) { $html .= "$val - <a href=\"?deleteFile=$val\">Usun</a><br>"; } $html .= "</div>"; $html .= '</body>'; $html .= '</html>'; ?>