file_get_contents()函数为空
if(isset($_REQUEST['act'])){ $act = $_REQUEST['act']; } if(isset($_REQUEST['filename'])){ $filename = $_REQUEST['filename']; } $redirect = "index.php?path={$path}"; if(isset($act)){ if($act == "createFile"){ //创建文件 $mes = createFile($path."/".$filename); alertMes($mes,$redirect); }elseif($act == "showContent"){ //查看文件内容 $content = file_get_contents($filename); highlight_string($content); } } ———————————————————— <td> <a href="index.php?act=showContent&path=<?php echo $path;?>&fileName=<?php echo $path."/".$val;?>"><img src="images/show.png" alt="" title="查看"/></a> <a href="index.php?act=editContent&path=<?php echo $path;?>&fileName=<?php echo $path."/".$val;?>"><img src="images/edit.png" alt="" title="修改"/></a> <a href="index.php?act=renameFile&path=<?php echo $path;?>&fileName=<?php echo $path."/".$val;?>"><img src="images/rename.png" alt="" title="重命名"/></a> <a href="index.php?act=copyFile&path=<?php echo $path;?>&fileName=<?php echo $path."/".$val;?>"><img src="images/copy.png" alt="" title="复制"/></a> <a href="index.php?act=moveFile&path=<?php echo $path;?>&fileName=<?php echo $path."/".$val;?>"><img src="images/cut.png" alt="" title="剪切"/></a> <a href="#" onclick="delFile('<?php echo $path;?>','<?php echo $path."/".$val;?>')"><img src="images/delete.png" alt="" title="删除"/></a> <a href="index.php?act=downFile&path=<?php echo $path;?>&fileName=<?php echo $path."/".$val;?>"><img src="images/download.png" alt="" title="下载"/></a> </td>
php.ini配置:allow_url_fopen = On ,并且没有禁用此函数。
但是就是无法使用。提示:
Notice: Undefined variable: filename in
Warning: file_get_contents(): Filename cannot be empty in