Salve a tutti, sto impazzendo con uno script che con il mio vecchio php andava alla perfezione, ma con il 5.0.3 non ne vuole che sapere!!!
La cosa che mi fa impazzire è che sia lo switch che il "Codice Incriminato " da soli funzionano alla perfezione!!!
Quando sono assemblati però, una volta fatto il login, mi viene restituito "Impossibile Visualizzare la pagina" o se aggiungo dell'altro codice mi viene restituito "Azione Annullata"!!!
Ecco il codice:
Codice PHP:
<?
$dir 
"/path/alla/cartella/";
$login1 "pino";
$pass1 "123";

switch(
$status) {

case 
"ready":
if((
$login == $login1) && ($pass == $pass1)){

////INIZIO CODICE INCRIMINATO

function browse_tree($dir, &$filesize) { 
if (
is_dir($dir)) {
if (!isset(
$filesize)) $filesize=0;             
$handle=opendir("$dir");
while ((
$file readdir($handle))!==false) { 
if ((
$file != ".") && ($file != "..")) {
$new_dir=$dir."/".$file;
if (
is_dir($new_dir))  
browse_tree($new_dir, &$filesize);
else if (
is_file($new_dir)); 
$filesize+=filesize($new_dir);            


closedir($handle); 

return 
"$filesize";
}
$usato=browse_tree($dir, &$filesize);

function 
size_readable($size$unit null$retstring null)
{
$sizes = array("B""KB""MB""GB""TB");
$ii count($sizes) - 1;
$unit array_search((string) $unit$sizes);
if (
$unit === null || $unit === false) {
$unit $ii;
}
if (
$retstring === null) {
$retstring "%01.2f %s";
}
$i 0;
while (
$unit != $i && $size >= 1024 && $i $ii) {
$size /= 1024;
$i++;
}
return 
sprintf($retstring$size$sizes[$i]);
}

////FINE CODICE INCRIMINATO

$usatox size_readable($usato);
echo 
$usatox;

}else{
echo 
"Unauthorized Access!";
}

break;

default:

echo 
"<form name=log method=\"post\" action=\"?status=ready\">";
echo 
"Username: <input type=\"text\" name=\"login\">
"
;
echo 
"Password: <input type=\"text\" name=\"pass\">

"
;
echo 
"<input type=\"submit\" value=\"Login\"></form>";
break;

}
?>
Vi prego datemi una mano!