holà!

ho una struttura file del genere:

codice:
mio sito
|
|
+---> importa/
|      |
|      |
|      +---> importa.php
|
|
+---> appuntamenti-notizie-enogastronomiche/
      |
      |
      +---> sagre/
            |
            |
            +---> sagra01.html
            |
            +---> sagra02.html
            .
            .
in importa.php devo scorrere la cartella sagre e caricare il testo in un db, ma quello che non capisco è perché la funzione dir per scorrere la directory non vada.

ho fatto così [come da manuale]:

Codice PHP:
$real_path realpath("../appuntamenti-notizie-enogastronomiche/sagre/");
$d dir($real_path);
echo 
"Handle: " $d->handle "
\n"
;
echo 
"Path: " $d->path "
\n"
;
echo 
"
"
;
while (
false !== ($entry $d->read())) {
    if (
$entry=='.' || $entry=='..' || $entry=='importa.php' )
        continue;
    echo 
$entry."<hr />\n";

ma mi restituisce:

Handle:
Path:


Fatal error: Call to a member function on a non-object in /store/domains/test.evoltel.com/manuel/ricette/importa/importa.php on line 10
dove la riga 10 è quella del while. Dove sbaglio?
anche il fatto che non mi scriva nulla in Handle: e Path: non è bello



Grazie!