Saved Bookmarks
| 1. |
Solve : php print forbidden directory contents? |
|
Answer» Just wondering if this is possible, i use the rack111.com webhost i have a free account and i couldnt find anyway to GIVE guests permission to access the folders individually , i chmod them all but only the files are accessible, for example.. http://aurai.rack111.com/upload/ wont show the directory contents , instead i GET 403 forbidden, i cant set the permissions for this.. so how can i work AROUND it?Use this script: Code: [Select]<?php $dir="upload/"; $files=scandir($dir); foreach($filesas$key=>$value) { echo$value; } ?> thanks kpac, it works.. Just one last thing i cant figure out, in the script you posted.. After echo $value i need to include ; So that it may print each filename to a new line.. <?php $dir = "upload/"; $files = scandir($dir); foreach($files as $key => $value) { echo $value ; } ?> But i cant get it working?? i know this should be simple but ive tryed it a few different ways without any success ??nevermind i figured it out , forgot the . thanks again Good. GLAD you got it working. |
|