Home >php教程 >php手册 >.ab.file,怎么做可以让他只访问ab目录

.ab.file,怎么做可以让他只访问ab目录

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-13 09:53:01923browse




'./a/b/'.$file,怎么做可以让他只访问a/b目录

'./a/b/'.$file
如果$file = '../1.php'
就可以访问/a/1.php 了
$file由用户输入,只允许其访问'./a/b/'下的文件因该怎么做

我来回答




D8888D回贴内容-------------------------------------------------------
取前两个字符.看看是不是".."
如果是就阻止


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