note 112173 rejected from function.chmod by googleguy
| From: | googleguy@php.net | Date: | Tue, 14 May 2013 07:36:26 +0000 |
| Subject: | note 112173 rejected from function.chmod by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-194795@lists.php.net to get a copy of this message | ||
Note Submitter: manbir1993 at hotmail dot it
----
I have a problem with the opening of a folder with php.
It shows this error:
Forbidden
You don't have permission to access /CLIENTI/lala/ on this server.
AND here it is the php code:
$dir = "CLIENTI/";
chmod('CLIENTI/lala',0644);
$before = '';
$after = '';
if (is_dir($dir)) { chmod("CLIENTI",0777);
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
if( ($file !='.')&&($file !='..') ){
chmod($dir."/".$file, 0644);
echo $before.'<a href="'.$dir.$file.'"
>'.$file.'</a>'.$after. "\n";
echo "<br>";
}
}
closedir($dh);
}
}