php - How to readdir in ../ on lighttpd? Permissions? -


i'm trying read folder names , create buttons out of via .php. somehow doesn't work how want work.

foldernames read in /www/templates/

.php file in /www/php/

tried to: put read.php in /www/templates/, telling opendir() , readdir() of "./" , include /www/php/ -> shown me results (folders) of /www/php/ (where works , shows folders of "./" if it's placed in there aswell). tried using complete path ( /opt/xyz/www/templates/ ) -> no result @ all

chmod of folders 766 - owner same php script.

script placed in /www/php/:

<?php $d = opendir('../templates/'); while(false !== ($f = readdir($d))) { if (is_dir($f) && $f != "." && $f != "..") { echo "<form action=\"./change.php\" method=\"get\"> <input type=\"submit\" name=\"template\" value=\"" . $f . "\"><br>"; } } ?> 

script tried in /www/templates/:

<?php $d = opendir('./'); while(false !== ($f = readdir($d))) { [insert-code-from-above-here] } ?> 

included script in /www/templates/ "index.php" with:

<?php include('../templates/read.php'); ?> 

webserver: lighttpd


Comments

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -