PHP - Writing to file (UNIX and Windows)
Posted: Mon Oct 06, 2003 11:31 am
Hello, I am a PHP newbie and I have created a script to write some text to a file. It has been giving me this error
Warning: fopen(./category.xml): failed to open stream: Permission denied in c:\inetpub\wwwroot\PHP_Fusebox\csc513\act_generateXML.php on line 16
Cannot open file
Here is the code example
$myfilename = "./category.xml";
if (!($fp=fopen("$myfilename","w"))) die("Cannot open file");
if(!(fwrite($fp,"Hello world"))) die("Error in writing");
fclose($fp);
Any help is appreciated
Warning: fopen(./category.xml): failed to open stream: Permission denied in c:\inetpub\wwwroot\PHP_Fusebox\csc513\act_generateXML.php on line 16
Cannot open file
Here is the code example
$myfilename = "./category.xml";
if (!($fp=fopen("$myfilename","w"))) die("Cannot open file");
if(!(fwrite($fp,"Hello world"))) die("Error in writing");
fclose($fp);
Any help is appreciated