Create a file
Date: 11/24/06
(PHP Community) Keywords: no keywords
This is the script I used to use to create a file.
//name of file I want to create
$filename = "openfile.php";
//open file
$openfile=fopen($filename,"w");
//this is some content
$filecontent = "ephi is terribly lousy in remembering things.";
//I put the content there
fputs($openfile, $filecontent);
//and close the file
fclose($openfile);
?>
Default folder file permission is 755.
Any new file in the folder is set to be 644.
Now the script doesn't work anymore,
except if I changed the folder permission
to 757 or 777.
But, I didn't wish to do that.
Any work around you can suggest? Thanks.
Source: http://community.livejournal.com/php/513869.html