Hi guys. I’m currently studying PHP language. I already installed IIS on my PC and a PHP server, and test some codes that i found from a tutorial. But there was an error. I can’t determine what was the problem.
This was the code from the tutorial.
<?php
$today = date("y-m-d");
$fh = fopen("flat.txt","a");
fwrite($fh,$today);
fclose($fh);
echo "$today";
?>
This was the output from my PC.
07-08-07PHP Warning: fopen(flat.txt) [function.fopen]: failed to open stream:
Permission denied in C:\Inetpub\wwwroot\simple_editor\flat.php on line 3 PHP Warning:
fwrite(): supplied argument is not a valid stream resource in
C:\Inetpub\wwwroot\simple_editor\flat.php on line 4 PHP Warning: fclose(): supplied
argument is not a valid stream resource in C:\Inetpub\wwwroot\simple_editor\flat.php on
line 5
I think there are no problems from the code itself. I think the problem came from my computers security. Can any one help me out.
Thanks in advance.