Sto facendo un script per navigare fra le cartelle del mio host e visionare i files
Riesco a vedere le immagina, ma con i file .php non me le ristuisce tipo testo, i file .html mi esegue la .dtd, riesco a vedere senza problemi solo i files .txt o .cgi
che sia un problema di header o mime type?
ecco il codice che ho scritto fin qui':
[php]
<?php
//
// Se è una directory ..
if ( is_dir($path) ) {
echo "Path: <font color=white>$path</font>
\n";
$path .= "/";
if ($dh = opendir($path)) {
echo "<html><head><title>$path</title>";
echo "<style></style>\n";
echo "</head><body bgcolor=#4791C5>\n";
echo "<table bgcolor=#333 align=center border=0 width=100% cellpadding=3 cellspacing=1><tr bgcolor=#9acd32>\n";
echo "<td>Filename</td><td>Filetype</td><td>Filesize</td><td>Last_mod</td><td>Chmod</td>\n";
echo "</tr>\n";
while ( ($file = readdir($dh)) !== false )
{
$filename = $file;
$fullname = $path . $file;
$filetype = filetype($fullname);
$filesize = filesize($fullname);
$file_last_mod = date ("F d Y H:i:s.", filemtime($fullname));
$file_chmod = substr(sprintf('%o', fileperms($fullname)), -4);
if (is_dir($fullname)) { $bgcolor="#fff"