Home  >  Article  >  Backend Development  >  .ab.file, how to make it access only the ab directory_PHP tutorial

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

WBOY
WBOYOriginal
2016-07-13 10:51:43777browse




'./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...
Statement:
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