Hi,
I have this code that creates some files on my server(doorways). It also creates the folder to put these files in and it is creating the folder CHMOD 777.
But the files in the folder are created CHMOD 666. Is there something to add to this code to create the files as CHMOD 644 ? 😕
//The Code
<?php
if($VAR_action == "process"){
//$name $key $html $url
$int = umask(0);
if(mkdir($name, 0777)){
$key = explode(" ", $key);
$link = "";
for($x=0; $x < sizeof($key); $x++){
$tmp = ereg_replace("{Key}", $key[$x],
stripslashes($html));
$handle = fopen("$name/" . $key[$x] . ".php", "w");
fwrite($handle, $tmp);
fclose($handle);
$link .= "<a href=\"" . $url . "/" . $name . "/" .
$key[$x] . ".php\">" . $key[$x] . "</a><br>\n";
}
$tmp = "<html>\n<head>\n";
$tmp .= "<title>$name</title>\n";
$tmp .= "</head>\n";
$tmp .= "<body>\n";
$tmp .= "<h1>$name</h1>\n";
$tmp .= $link;
$tmp .= "</body>\n</html>\n";
$handle = fopen("$name/index.php", "w");
fwrite($handle, $tmp);
fclose($handle);
$tmp = "$url/$name/index.php\n";
$handle = fopen("file.txt", "a");
fwrite($handle, $tmp);
fclose($handle);
$VAR_mess = "Operation successfully completed.";
}
else
$VAR_mess = "Error. Directory not created.";
}
?>
Thanks for your time in Advance
James