stevesimo Posted September 2, 2008 Share Posted September 2, 2008 Hi, I have a script which creates a new folder on the server which I then want to save a textfile into. The folder is being created and is CHMOD to 777 but the textfile is not being saved into the folder. Can anyone see what I am doing wrong? Not sure if my file path is incorrect. //create folder using id mkdir("./".$id, 0777); //now chmod to 0777 chmod("./".$id."/", 0777); $output = 'Some text to save in file goes here...'; //now save textfile using id as name $textpage = fopen("/".$id."/".$id.".txt","w"); fwrite($textpage,$output); fclose($textpage); Thanks, Steve Link to comment https://forums.phpfreaks.com/topic/122377-problem-saving-file-to-newly-created-folder/ Share on other sites More sharing options...
BlueSkyIS Posted September 2, 2008 Share Posted September 2, 2008 do you get any errors? if not: do you have error reporting turned on? i would expect an error if the file fails to write. Link to comment https://forums.phpfreaks.com/topic/122377-problem-saving-file-to-newly-created-folder/#findComment-631916 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.