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

php code generators
All

Whilst enjoying learning a new language i have come accross a number of free code generat

Search in the PHP Files
have to search asterisk(*) in the php code of the php files .
In the html page one text box

want a code for uploading and downloading
i m trying to upload and download to my site..i need upload and download code ...i use a code for up

how can i display php source code snippets ?
I am outputting some pho code .. and I want to display the source code so people can copy and paste

PHP Thumbnail Creation
Ok so i use this function to create thumbnails:

Code: function createthumb($name,$filename,$n

Placing and array within an array then sorting it!
I have a page that runs two large mysql queries and saves the results into arrays, in php I then per

selection tool on raster image
Hi!
I have to implement in my app a selection tool which lets users to select region of any shape

mysql_affected_rows() usage
Possibly a MySQL issue, but the function that is not behaving in the anticipated way is a PHP functi

Ajax not working on IE 6 for Windows CE
I've created a webpage which uses the classis Ajax in following format:view plaincopy to clipboardpr

understanding functions and classes
Code: [Select]
class person {
var $name = "Jimmy Goe";

function get_nam

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