function renameFile($oldname,$newname){
echo $oldname,$newname;
}
elseif ($act=="renameFile"){
//完成重命名
$str=<<<EOF
<form action="index.php?act=doRename" method="post" >
请填写新文件名:<input type="text" name="newname" placeholder="重命名" /><br/>
<input type='hidden' name='filename' value='{$filename}' />
<input type="submit" value="重命名">
</form>
EOF;
echo $str;
}elseif ($act=="doRename"){
//实现重命名的操作
$newname=$_REQUEST['newname'];
renameFile($filename, $newname);
}
$newname=$_REQUEST['newname'];前加一句$filename = $_POST['filename'];
尝试一下