The following code is working but it doesn't update the contents of the file it created.
I can see that the file contents have changed (the size increased) but when I download the file from my server it's empty. the file is chmod to 666 and its parent directory as well.
its a linux server running Apache and PHP. I've also tried using fflush to force it to flush the contents.
<?php
header("Location: http://www.example.com");
$handle = fopen("log.txt", "a");
foreach($_POST as $variable => $value) {
fwrite($handle, $variable);
fwrite($handle, '=');
fwrite($handle, $value);
fwrite($handle, '
');
}
fwrite($handle, '
');
fflush($handle);
fclose($handle);
?>
what is the problem?
Thanks!