imarockstar Posted December 15, 2008 Share Posted December 15, 2008 I am trying to find a script that will tell me if a file or a directory is writable or not . ie. If I am trying to write to a file a persons phone number, I enter the number and if the file is writable it writes it. But if it is not writable, it displays a message telling me to make the file writable .. Basically I just need to know the appropriate IF ELSE statement for this to happen .. b Link to comment https://forums.phpfreaks.com/topic/137076-permissions/ Share on other sites More sharing options...
Maq Posted December 15, 2008 Share Posted December 15, 2008 $filename = 'test.txt'; if (is_writable($filename)) { echo 'The file is writable'; } else { echo 'The file is not writable'; } Link to comment https://forums.phpfreaks.com/topic/137076-permissions/#findComment-715901 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.