moyyom
05-06-2009, 08:45 PM
Currently I have a function that writes a PHP file to a directory given a random string.
My write function is as follows:
function write($where, $what){
$myFile = $where;
$fh = fopen($myFile, 'w');
fwrite($fh, $what);
fclose($fh);
}
The only problem with it is, the index.php file that I create in the directory needs to be able to run a password protect PHP script. I don't know how to write a file AND give it permissions. If anyone could help me do that, it would be awesome.
I need to give the file that the write() function creates permissions... <-- simple form.
My write function is as follows:
function write($where, $what){
$myFile = $where;
$fh = fopen($myFile, 'w');
fwrite($fh, $what);
fclose($fh);
}
The only problem with it is, the index.php file that I create in the directory needs to be able to run a password protect PHP script. I don't know how to write a file AND give it permissions. If anyone could help me do that, it would be awesome.
I need to give the file that the write() function creates permissions... <-- simple form.