PHP fopen

Status
Not open for further replies.

galaxyAbstractor

Community Advocate
Community Support
Messages
5,508
Reaction score
35
Points
48
PHP:
$bwfile = filesize("./storage/".$foundfile[0]);
$bwfile = $bwfile / 1024;

$file = 'secure/stat.txt' or die('Could not open file!');

$fh = fopen($file, 'r') or die('Could not open file!');
$data = fread($fh, filesize($file)) or die('Could not read file!'); //here it stops
fclose($fh);

$result = $data+$bwfile;
$fh = fopen($file, 'w') or die('Could not open file!');
fwrite($fh, $result) or die('Could not write to file'); 

fclose($fh);

Why does not this work? It's windows vista, so chmod is no problems...
 
Last edited:

gomarc

Member
Messages
516
Reaction score
18
Points
18
Try this on line 6:

$fh = fopen($file, 'rb') or die('Could not open file!');
 
Status
Not open for further replies.
Top