I'm trying to write a code that takes two variables entered by the user via input boxes and saves them in a text file, without overwriting other entries. Unfortunately the strings are not showing up in the text file. Heres the code I'm using
I am new to PHP, and I'm sure I'm making a dumb mistake. Any advice would be greatly appreciated.
PHP said:$handle = fopen("datalog.txt", "a");
foreach($_POST as $variable => $value) {
fwrite($handle, $variable);
fwrite($handle, "=");
fwrite($handle, $value);
fwrite($handle, "\r\n");
}
fwrite($handle, "\r\n");
fclose($handle);
exit;
I am new to PHP, and I'm sure I'm making a dumb mistake. Any advice would be greatly appreciated.