I have the following code:
<?php
$myfile = fopen("code2.css", "w") or die("Unable to open file!");
$txt = "John Doe\n";
fwrite($myfile, $txt);
$txt = "Jane Doe\n";
fwrite($myfile, $txt);
fclose($myfile);
?>
?>
code2.css is in the same folder as my PHP file, but it throws me:
Unable to open file all the time.
How can I fix this?
Update: After playing with permissions the error dissapeared, but still my file won't be updated.