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 Quote 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'; } Quote Link to comment https://forums.phpfreaks.com/topic/137076-permissions/#findComment-715901 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.