Total members 11895 |It is currently Sun Dec 22, 2024 9:10 am 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     -  
 file descriptor vs file pointer     -  
 getting file name of html input file tag using jsp     -  
 How to convert xml file to Pdf file using C     -  
 C++ File I/O     -  
 web.xml file     -  
 NS-2 and Trace file     -  
 Reading the all file in php     -  



Topic Tags

PHP Files and I/O






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