Mam problem z funkcją filesize.
Oto kod:
Kod
<html><head><title>Otwieranie pliku</title></head>
<body bgcolor="lavender">
<?php
$filename = 'http://192.168.1.50/test.txt';
$filehandle = fopen($filename, 'rt');
$contents = fread($filehandle, filesize($filename));
print "<pre>$contents</pre>";
fclose($filehandle);
?>
</body>
</html>
<body bgcolor="lavender">
<?php
$filename = 'http://192.168.1.50/test.txt';
$filehandle = fopen($filename, 'rt');
$contents = fread($filehandle, filesize($filename));
print "<pre>$contents</pre>";
fclose($filehandle);
?>
</body>
</html>
Wynik na ekranie:
Warning: fread() [function.fread]: Length parameter must be greater than 0 in /var/www/Rozdzial11/listing11.6.php on line 6
Po wybraniu [function.filesize] na w/w warrningu otrzymuję:
Not Found The requested URL /Rozdzial11/function.filesize was not found on this server. Apache/2.2.14 (Debian) Server at 192.168.1.50 Port 80
Ten sam kod na serwerze lokalnym działa prawidłowo. Co jest źle ustawione na serwerze zewnętrznym ?
Krzysiek