eccolo, grazie dell'aiuto!
codice:
<?php
error_reporting (E_ALL ^ E_NOTICE);
include ("setting.php");
echo"0<br>";
//lettura file nella dir notifiche
function dir_list($directory = FALSE)
{
$dirs= array();
$files = array();
echo"1 ${files}<br>";
//if ($handle = opendir("./" . $directory))
if ($handle = opendir($directory))
{
echo"2<br>";
while ($file = readdir($handle))
{
echo"a---- $file -----<bR>";
if (is_dir("{$directory}{$file}"))
{
if ($file != "." & $file != "..") $dirs[] = $file;
echo"b---- $file -----<bR>";
}
else
{
if ($file != "." & $file != "..") $files[] = $file;
echo"c---- $file -----<bR>";
}
}
}
closedir($handle);
reset($dirs);
sort($dirs);
reset($dirs);
reset($files);
sort($files);
reset($files);
//ciclo lettura file nella DIR notifiche
while(list($key, $value) = each($files))
{
$f++;
###### lettura riga/riga
include ("setting.php");
$fileqc=$pathCSV.$value;
$news=fopen($fileqc,"r"); //apre il file
while (!feof($news)) {
$rigaok = fgets($news, 4096);
###### FINE lettura riga/riga
//divide la riga
$riga=strrev($rigaok);
if($riga=="")
{
die();
}
///////////////////////// Inserimento nel DB /////////////////////////
}//fine while (!feof($news)) {
fclose ($news); #chiude il file
//mysql_close();
echo"<bR>*********** $pathCSV$value ***************<bR>";
//archivia le notifiche ingest
copy("$pathCSV$value","$pathCSVarchivio$value");
unlink("$pathCSV$value");
}//FINE while(list($key, $value) = each($files)){
if (!$d) $d = "0";
if (!$f) $f = "0";
}//FINE function dir_list($directory = FALSE){
dir_list($pathCSV);
?>