Jump to content

[SOLVED] fwrite


unidox

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.