Hi
I cannot get this to work.
How come ?
LINK: http://m.iceb.dk/readu.php
ERROR: Warning: filesize(): Stat failed for Resource id #2 (errno=2 - No such file or directory) in /var/www/epoxy/web2/icebdk/docs/readu.php on line 4
CODE:
<?php
$fp = fopen("readme.txt", "r");
$data = fread($fp, filesize($fp));
echo $data;
?>
fopen cannot locate file??
Moderator: General Moderators
-
litebearer
- Forum Contributor
- Posts: 194
- Joined: Sat Mar 27, 2004 5:54 am
Reading the contents
writing to the file
hope this helps.
Lite...
Display the contents$filename = 'c:\file.txt';
$fp = fopen($filename, "r");
$contents = fread($fp, filesize($filename));
fclose($fp);
print $contents;
writing to the file
$filename = 'c:\file.txt';
$fp = fopen($filename, "a");
$string = "\nline5";
$write = fputs($fp, $string);
fclose($fp);
hope this helps.
Lite...