| 
 Posted by Stefan Bellon on 06/18/59 11:39 
Hi all! 
 
I want to parse the contents of an .htaccess file from within PHP. The 
contents of the .htaccess file looks like this: 
 
<Files foobar.tar.gz> 
AuthType Basic 
AuthUserFile /foobar 
AuthName "Foobar" 
<Limit GET> 
Require user FOOBAR 
</Limit> 
</Files> 
 
And so on. When I read in that file with the following code: 
 
$fd = fopen(".htaccess", 'rb'); 
while (!feof($fd)) { 
   $line = fgets($fd, 1024); 
   echo "|".$line."|\n"; 
} 
fclose($fd); 
 
Then I get empty lines for those lines containing <Files ...>, 
<Limit ...> and so on. How can I get at those lines as well? 
 
What I need to know is basically the information "which user can access 
which file?" 
 
--  
Stefan Bellon
 
[Back to original message] 
 |