unidox Posted May 16, 2008 Share Posted May 16, 2008 I am trying to create a log script, but its not working how I want it. I want it to add to the file, not overwrite. Here is my code: $file = "logs/log.txt";$size = filesize($file);$open = fopen($file, "w+b");$read = fread($open, $size);$write = $_GET['write'] . "\n";$content = $read;$content .= $write;fwrite($open, $content);fclose($open); but it keeps destroyin the content already in the file and overwriting it. Whats wrong Link to comment https://forums.phpfreaks.com/topic/105945-solved-fwrite/ Share on other sites More sharing options...
pocobueno1388 Posted May 16, 2008 Share Posted May 16, 2008 Take a look at this tutorial http://www.tizag.com/phpT/fileappend.php Link to comment https://forums.phpfreaks.com/topic/105945-solved-fwrite/#findComment-542939 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.