Can u plz explain detail program about File Permissions in PHP.
msi_333
Question subject: Re: File Permission
Posted: Thu Sep 08, 2011 7:34 pm
Joined: Tue Mar 27, 2007 10:55 pm Posts: 2279 Location: Earth Has thanked: 39 time Have thanks: 61 time
To control file permission in PHP you can use "chmod" function.
Code:
<?php // Set Permission For Owner :Read and write. // Everyone else : nothing chmod("/directory/test.txt", 0600); // Set Permission For Owner :Read and write. // Everyone else : read only
chmod("/directory/test.txt", 0644); // Set Permission For Owner :Everything . // Everyone else : read and execute .
chmod("/directory/test.txt", 0755); // Set Permission For Owner :Everything . // owner's group: read and execute. // Everyone else : nothing.