I'm having a bit of trouble here. I've created a form that takes data from a text field and (is supposed to) write the data to the end of a .txt file.
However, using file_put_contents
simply overwrites whatever was in the file beforehand with the submitted data. I'm not sure why this is happening, as I've used this before without fail.
PHP Code:
$line = "Name: " . $name . "---" . "Question: " . $question;
file_put_contents('questions.txt', $line . PHP_EOL, FILE_APPEND);