Create a File and set Directory Permissions

Dj SharK

New Member
I'm using this PHP code below to create dynamic xml files.\[code\]...$file_name = "";$rss_feed_dir = $_SERVER['DOCUMENT_ROOT'] . '/xml/';chmod($rss_feed_dir, 0777);$file = $rss_feed_dir . $file_name . '.xml';$file_handle = fopen($file, "w");fwrite($file_handle, $xml);fclose($file_handle);\[/code\]The file will be created if the directory permissions are set 0777, and seems to fail at 0755. I've read on many sites that world execute permissions can pose a security risk.Should I chmod back to 0755 at the end of this script?Is there a better way to set the directory permissions?
 
Back
Top