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
2016-11-23
ok,自己解決了。(感覺自己好蠢…)