Hi,
I'm new to php although I have quite advanced programming experience, so I'm learning quickly.
I've decided to try and write a sort of enhanced Directory Listing "index of" script, but I'm having a couple of problems.
I can get it working, but it's got a few bugs, and is very insecure.
For example, someone could easily type in the following line to view the content of my /etc folder into a browser:
Also, there's another couple of problems. If someone was to type in:
it would display the documents folder (as PHP accepts this as a valid path), but the title of my page ("index of ...."), and all the links would also contain all the extra slashes.
My last problem is that when people follow the ".." folder to move to the parent directory, my path ends up being in this form:
/child_dir/../ and not /parent_dir/
which looks a little strange.
If anyone knows of any example code I could look at that would be great. I'm sure this has been done quite a lot before.
Many thanks,
Daniel Briley
I'm new to php although I have quite advanced programming experience, so I'm learning quickly.
I've decided to try and write a sort of enhanced Directory Listing "index of" script, but I'm having a couple of problems.
I can get it working, but it's got a few bugs, and is very insecure.
For example, someone could easily type in the following line to view the content of my /etc folder into a browser:
Also, there's another couple of problems. If someone was to type in:
it would display the documents folder (as PHP accepts this as a valid path), but the title of my page ("index of ...."), and all the links would also contain all the extra slashes.
My last problem is that when people follow the ".." folder to move to the parent directory, my path ends up being in this form:
/child_dir/../ and not /parent_dir/
which looks a little strange.
If anyone knows of any example code I could look at that would be great. I'm sure this has been done quite a lot before.
Many thanks,
Daniel Briley