Hallo ich habe vor 2 wochen mit php angefanegn und scripte mich so durch die gegend :-) .Also ich habe folgendes problem mit diesem script von mir:
<?php
$ordner = "./txt/";
$handle = opendir($ordner);
while ($file = readdir ($handle))
{
if($file != "." && $file != "..")
{
if(is_dir($ordner."/".$file))
{
echo "/".$file."<br/>";
}
else
{
echo "<table border=1>"
echo "<tr>";
echo "<td>";
$lese = fopen("$file","r");
echo fread($lese,10);
fclose($lese);
echo "</td>";
}
}
}
closedir($handle);
?>
Fehlermeldung:
Warning: fopen(d.txt) [function.fopen]: failed to open stream: No such file or directory in C:\Programme\xampp\htdocs\ddl\read2.php on line 17
Warning: fread(): supplied argument is not a valid stream resource in C:\Programme\xampp\htdocs\ddl\read2.php on line 18
Warning: fclose(): supplied argument is not a valid stream resource in C:\Programme\xampp\htdocs\ddl\read2.php on line 19
Warning: fopen(dd.txt) [function.fopen]: failed to open stream: No such file or directory in C:\Programme\xampp\htdocs\ddl\read2.php on line 17
Warning: fread(): supplied argument is not a valid stream resource in C:\Programme\xampp\htdocs\ddl\read2.php on line 18
Warning: fclose(): supplied argument is not a valid stream resource in C:\Programme\xampp\htdocs\ddl\read2.php on line 19
Warning: fopen(ddd.txt) [function.fopen]: failed to open stream: No such file or directory in C:\Programme\xampp\htdocs\ddl\read2.php on line 17
Warning: fread(): supplied argument is not a valid stream resource in C:\Programme\xampp\htdocs\ddl\read2.php on line 18
Warning: fclose(): supplied argument is not a valid stream resource in C:\Programme\xampp\htdocs\ddl\read2.php on line 19
es währe sehr net wenn mir einer sagen könnte was ich falsch gemacht habe und wenn er wenn er lust hat das script berichtigt
<?php
$ordner = "./txt/";
$handle = opendir($ordner);
while ($file = readdir ($handle))
{
if($file != "." && $file != "..")
{
if(is_dir($ordner."/".$file))
{
echo "/".$file."<br/>";
}
else
{
echo "<table border=1>"
echo "<tr>";
echo "<td>";
$lese = fopen("$file","r");
echo fread($lese,10);
fclose($lese);
echo "</td>";
}
}
}
closedir($handle);
?>
Fehlermeldung:
Warning: fopen(d.txt) [function.fopen]: failed to open stream: No such file or directory in C:\Programme\xampp\htdocs\ddl\read2.php on line 17
Warning: fread(): supplied argument is not a valid stream resource in C:\Programme\xampp\htdocs\ddl\read2.php on line 18
Warning: fclose(): supplied argument is not a valid stream resource in C:\Programme\xampp\htdocs\ddl\read2.php on line 19
Warning: fopen(dd.txt) [function.fopen]: failed to open stream: No such file or directory in C:\Programme\xampp\htdocs\ddl\read2.php on line 17
Warning: fread(): supplied argument is not a valid stream resource in C:\Programme\xampp\htdocs\ddl\read2.php on line 18
Warning: fclose(): supplied argument is not a valid stream resource in C:\Programme\xampp\htdocs\ddl\read2.php on line 19
Warning: fopen(ddd.txt) [function.fopen]: failed to open stream: No such file or directory in C:\Programme\xampp\htdocs\ddl\read2.php on line 17
Warning: fread(): supplied argument is not a valid stream resource in C:\Programme\xampp\htdocs\ddl\read2.php on line 18
Warning: fclose(): supplied argument is not a valid stream resource in C:\Programme\xampp\htdocs\ddl\read2.php on line 19
es währe sehr net wenn mir einer sagen könnte was ich falsch gemacht habe und wenn er wenn er lust hat das script berichtigt
Kommentar