<?php
//dir_chmod.php
function simple()
{
$path = "http://manas6/myphp/File_Directories/Directoris/chgrp.txt";
$password ="my_admin";
echo "<u> Path </u>:   $path<br/>";
$base = basename($path);
echo "<u>Read file name of the base directory</u> :   $base<br/>";
$base_name = basename($path, ".txt");
echo "<u>Read file name with out extension</u> :  $base_name<br/>";
}
?>
<html>
<title> dir_chmod.php</title>
<body text="#000080" bgcolor="#F7F0D7">
<?php
//$test=$_POST[T1];
simple();
?>
<?php
// Read and write for owner, nothing for everybody else
if(chmod($path,0600)){echo "You got it : R W for owner, R for others
nothing<br/>";} else { echo "oops"; }
if(chmod($path,0644)){echo "You got it : R W E for owner R E for others <br/>";}
else { echo "oops"; }
if(chmod($path,0755)){echo "You got it : R W E for owner R E for others <br/>";}
else { echo "oops"; }
if(chmod($path,0740)){echo "You got it <br/>";} else { echo "oops"; }
?>
// Read and write for owner, nothing for everybody else
<br>chmod("/somedir/somefile", 0600);
<br>
// Read and write for owner, read for everybody else
<br>chmod("/somedir/somefile", 0644);
<br>// Everything for owner, read and execute for others
<br>chmod("/somedir/somefile", 0755);
<br>// Everything for owner, read and execute for owner's group
<br>chmod("/somedir/somefile", 0750);
</body>
</html>