I'm stuck on letting php create files on my server from the html forms output. It doesn't have permission to create these files. I tried different approaches I around here but can't get it to work.
Here's my code which creates the file from the Form data:
$file = 'r-data/car-form-data-'.time().'-'.rand(1000,9999).'.JSON';
file_put_contents($file, json_encode($_POST));
Is somebody able to help to make this approach work?
Thank you.
Maybe www-data doesn't have right to write on your folder. Try chmod -R 777
on your folder or set acl.