.ab.file, how to make it access only the ab directory_PHP tutorial

WBOY
Release: 2016-07-13 10:51:43
Original
776 people have browsed it




'./a/b/'.$file, how to make it only access the a/b directory

'./a/b/'.$file
If $file = '../1.php'
You can access /a/1.php
$file is entered by the user and is only allowed to access files under './a/b/'. What to do

Let me answer




D8888D reply content------------------------------------------------- ----------
Take the first two characters and see if they are ".."
If so, block


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/632539.htmlTechArticle'./a/b/'.$file, how can I make him access only the a/b directory' ./a/b/'.$file If $file = '../1.php', you can access /a/1.php. $file is entered by the user and only allows access to './a/b/'. The following text...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template