|
view:
<textarea id="readtxt" name="readtxt" style="width:100%;height:300px;" ><?php echo set_value('readtxt',$readtxt); ?></textarea>
Control:
//存
if(read_file($txt))
{//读
$output=read_file($txt);
}
else
{
$output="User-agent: *
Allow: /
Sitemap: http://".$_SERVER['SERVER_NAME']."/sitemap.xml";
write_file($txt, $output,'a+');
}
$output=str_replace("\n","",$output);
$data['readtxt']=$output;
--------------------------------
//取出,上一步保存的txt无问题,但下面再存一下就多了好多格
$output=$this->input->post('readtxt');
$output=(str_replace("","\n",$output));
write_file($txt, $output,'r+');
$data['success'] = '<div class="suc">更新成功!</div>';
$output=read_file($txt);
$output=str_replace("\n","",$output);
$data['readtxt']=$output;
$this->load->view('admin/setting/edit_txt',$data); |
|