Total members 11890 |It is currently Fri Apr 19, 2024 6:50 pm Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





Detail program about File Permissions in PHP.
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.
 
chmod("/directory/test.txt"0750);


// owner, group ,everyone else : read ,write execute.  
chmod("/directory/test.txt"0777);
?>


it is all about the code of permission
Code:
7       4      4
user   group  world
r+w+x    r      r
4+2+1  4+0+0  4+0+0  = 744





Author:
Post new topic Reply to topic  [ 1 post ] 

  Related Posts  to : File Permission
 Applet File Permission     -  
 Encrypt/Decrypt a file from source file to target file.     -  
 Copy file to file in java code- implementation     -  
 getting file name of html input file tag using jsp     -  
 file descriptor vs file pointer     -  
 How to convert xml file to Pdf file using C     -  
 C++ File I/O     -  
 web.xml file     -  
 Random to File     -  
 Close a file in php     -  



Topic Tags

PHP Files and I/O
cron





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com