Salve, ho trovato in internet uno script che mi fa un elenco di tutti i file nel mio sito
Ecco il codice:
codice:
<?
// Processing directories
$path = "";
for ($i=0; $i<=$sub; $i++)
{
$folder = chdir($directory[$i]);
$path = $path . $directory[$i] . "|";
if (($directory[$i] != "") and ($directory[$i] != "."))
echo " - " . $directory[$i] . "";
}
echo "\n<hr>\n";
// Getting directory's info...
$folder = opendir(".");
while ($file = ReadDir($folder))
{
$file_array[] = $file;
}
// Processing Files&Directories list element by element
foreach ($file_array as $file) {
if (($file == ".") || ($file == "..") ) continue;
// Checking if it is a directory or a file
if (FileType($file) == dir)
{
if ($inpath != "")
{
$path = $inpath . $file . "|";
$subw = $sub + 1;
}
else
{
$path = $file ."|";
$subw = 1;
}
echo "<a class=\"dir\" href=%22dirlist.php?dir=".$path."&sub=".$subw."/">".$file."</a>
\n";
}
else
{
if ($inpath != "")
$path = str_replace("|","/",$inpath) . $file;
else
$path = $file;
echo "".$file."
\n";
}
// Unsetting all variables
unset($file_array);
unset($file);
unset($folder);
unset($directory);
unset($sub);
unset($subw);
unset($path);
}
?>
Vi volevo chiedere se c'era un modo per non far comparire il tipo di file cioè se ho una pagina che si chiama home.html lo lascia home .