So this is my code:
<?php
$path = 'logs/' . date("Y:m:d") . '.txt';
$get = $_POST['data']; // I know this is insecure, don't worry
$file = fopen($path, 'w') or die("Something is wrong with your file permissions, please obtain the nessecary rights!");
fwrite($file, $get) or die('error writing to file');
?>
the fopen()
function works fine, I don't get any error whatsoever. The problem is that I get an "error writing to file
" meaning there is something wrong with my fwrite()
function.
What could be the problem here?
I'm using apache2 and php7.