#1 小双
class edittpl extends spController
{
/**
* 后台模板管理模块
*/
public function index(){
$file = fopen("tpl/tpl.html","r") or exit("error");
$fr = fread($file,filesize("tpl/tpl.html"));
$this->content = $fr;
fclose($file);
}
/**
* 修改
*/
public function edit(){
$content = $this->spArgs('content');
$fileopen = fopen("tpl/tpl.html","w") or exit("error");
fwrite($fileopen,$content);
fclose($fileopen);
$this->success("编辑成功!", spUrl("edittpl","index"));
}
}
这是我写的代码,遇到模板里面有textarea就头大了,还有html的内容也会显示在页面里?怎么解决,大家给个思路!
2010-05-26 17:47:48