a function to check directory depth


Posted on 16th Feb 2014 07:03 pm by admin

I'm working on a php script to upload files in to a set directory.
the user can select to upload into the "upload" directory or any of its subdirectories.
at the moment the user is able to `trick` the script into uploading a file into a lower directory by typing in "upload/../../" as the upload directory

Did you know?Explore Trending and Topic pages for more stories like this.
I want to know if there is any way to verify the destination directory to make sure it is higher then the set directory.
Or use php.ini to restrict the directory allowed to upload

thanks
No comments posted yet

Your Answer:

Login to answer
91 Like 34 Dislike
Previous forums Next forums
Other forums

How to load mysql (and other) extensions into PHP
How to load mysql (and other) extensions into PHP PHP Development forum discussing coding practices,

Getting Resource id #11 while trying to connect..
So i tried using "DEFINE" for the first time and im using the variables i defined to conne

About imagecopyresampled()
Hello,

I am looking to use this function to resize parts of an image to a fixed thumbnail siz

pageination not working right... coping images over 4 pages
Code: <?php //This code will obtain the required page number from the $_GET array. Note that

Help with Hyperlink
Hi,

What I am trying to do may be simple, I just can't get it to work. Ok...

I am usin

PHP header help!
Hi all I am trying to get this php page to refresh every 5 seconds on my phone which is an aastra 48

HTML Viewer HIDE scrollbar
How can I disable scrollbars in a HTML Viewer control? I can't hide them. Even i have enough space b

Not Loading Function Into Div
I'm not sure whether to put this under the php forum or ajax forum but because I tink it's more of a

Need help/w Page: 1,2,3,4 function!
So I have this code im working on where it's ment to display seperate pages having 20 logs each
I

Problem with HTML form
Hello,

I made a HTML form with some fields and check box.
Everything works fine except whe

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash