ciao.
ho il seguente codice:
Codice PHP:
function getSelectModel($page){
$arrModels = array();
$file_handle = fopen($page, "r");
$i=0;
while (!feof($file_handle) ) {
$line_of_text = fgets($file_handle);
$parts = explode(';', $line_of_text);
$arrModels[$i]=$parts[0];
$i++;
}
fclose($file_handle);
$strSelect="<select>";
foreach($arrModels as $row)
{
$strSelect.="<option>".$row."</option>";
}
$strSelect.="</select>";
return $strSelect;
}
se chiamo la funzione con :
getSelectModel('db.txt')
e db.txt esiste , verificato con tanto di permessi di scrittura.
ottengo questi warning:
Warning: fopen(2) [function.fopen]: failed to open stream: No such file or directory in C:\Programmi\Apache Software Foundation\Apache2.2\htdocs\stagnini\stagninix\tes t.php on line 6
Warning: feof(): supplied argument is not a valid stream resource in C:\Programmi\Apache Software Foundation\Apache2.2\htdocs\stagnini\stagninix\tes t.php on line 8
Warning: fgets(): supplied argument is not a valid stream resource in C:\Programmi\Apache Software Foundation\Apache2.2\htdocs\stagnini\stagninix\tes t.php on line 9
Warning: feof(): supplied argument is not a valid stream resource in C:\Programmi\Apache Software Foundation\Apache2.2\htdocs\stagnini\stagninix\tes t.php on line 8
Warning: fgets(): supplied argument is not a valid stream resource in C:\Programmi\Apache Software Foundation\Apache2.2\htdocs\stagnini\stagninix\tes t.php on line 9
Warning: feof(): supplied argument is not a valid stream resource in C:\Programmi\Apache Software Foundation\Apache2.2\htdocs\stagnini\stagninix\tes t.php on line 8
Warning: fgets(): supplied argument is not a valid stream reso
ecc.c.