<分区>
我有以下代码:
<?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 与我的 PHP 文件位于同一文件夹中,但它抛出我:
Unable to open file all the time.
我该如何解决这个问题?
更新:使用权限后,错误消失了,但我的文件仍然不会更新。