I have a form for the user to input several pieces of data. When they submit the form, I need to append the data to a txt file. The form works well, but I can’t get it to append the data to the txt file. Here are the lines of my code:
$file = “member.txt”;
$data = $name.’|’$var1.’|’.$var2.’|’.$var3.’|’.$var4.’|’.$var5;
$myfile = file_put_contents($file, $data.PHP_EOL , FILE_APPEND | LOCK_EX);
Any help would be greatly appreciated.