Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Showing the files in the directory
Name: 010100100 (by wazir) Date: September 11, 2007 at 04:31:06 Pacific OS: XP CPU/Ram: 1024 Product: xx
Comment:
Hi,
I have got a directory on our domain. The directory contains pictures only. I want that if somebody type in the address of this directory, he should get a page with links to all the pictures. I don't want to keep on changing the source code with the links because the pictures in the directory keep getting added, deleted or changed. So putting a new link every time a new picture is added is an extra job. Is it possible with HTML, or PHP? Because these are the only two languages where I can do something. Many Thanks in Advance
Linux is basically a very simple Operating System, but you have to be a genius to understand its simplicity. http://www.cyberscout.net/
Name: Michael J (by mjdamato) Date: September 11, 2007 at 22:38:01 Pacific
Reply:
Yes, you can do it with PHP, but a simpler solution is to allow "file browsing" in the server settings. Then any folder where there is not a default file (such as index.htm" will be displayed exactly as you described.
Michael J
0
Response Number 2
Name: rhi Date: September 17, 2007 at 23:57:00 Pacific
Reply:
"File browsing" is dangerous because it allows everything to be downloaded from the folder of choice.
better solution will be to setup a free php script for image upload and management.
just goto hotscripts and download a script of your choice.
Summary: When yousay that it works from your machine I am assuming that you are running the html file from your machine as well - i.e., not running it through the web server. I have a feeling that there may be...
Summary: I got the code to work eventually by replacing: WHILE (false !== ($file = readdir($handle))) { //evaluate each entry, removing the . & .. entries IF (is_file($file) && $file !== '.' && $file !== '..')...
Summary: Just so we're clear you have the following structure: [main] --[home] --[bedroom] When specifying the path, you can move up a folder by using a double period ".." So, in a page that exists within the ...