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 Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.