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

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

Registration
ok so i have a site where people can register and login which works now thanks to someone on here th

Problem with HTML form
Hello,

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

Extracting Long text from message class with parameters
Hi,

I would like to extract the long text from a message class. However, the long text ha

form variables from database help.
Hi all,

I would like to have a form that gives you options based on the results of an mysql q

set xml path in flash when xml created in memorystream and webrequest
i am creating an xml file using memory stream and i want to load this xml file into the flash on cli

How to make a mail Form secure?
I want to create an email Form on my web site. How can I make the Form secure so the submitted info

Socket programming
Hello all,

I have a PHP socket script. GPS trackers connect to this socket. IMEI verification

Simple AND question
Hello,

I've got following code:

Code: if(strpos($row[13],"http://")

email CODING Problem
Email coding problem.

I need to send a section of the info to $tf and the same as a Cc to $em

modifying a property of an object from a different class
I have 2 classes:
- Math
- Distance

in my math class, I have this line:
$distance =

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