Listing contents of a directory
Moderator: General Moderators
Listing contents of a directory
I'm trying to make a form select where you can choose between the files in a directory. On an earlier version, I used opendir, etc because this script ran on the same server as the files. It worked great. Now I've had to move the script to a different server. I believe that opendir won't work on a www directory. I could open an FTP connection and read the files, but is there a better way to do it?
You can probably reuse your old script. Put it onto the second webserver (with the files) and let it generate output in a nice way (one file per line). Then you open your script (on the second webserver) from the first server. You can use fopen to open a file on another webserver.
I haven't used the php ftp-functionallity. But I assume it isn't very hard to manage .
I haven't used the php ftp-functionallity. But I assume it isn't very hard to manage .