php file_put_contents本地可以,服务器失败是怎么解决啊
functionsave(){$FILE='./siteconfig.inc.php';$title=$_POST['sitename'];//标题$webtitle=$...
function save(){
$FILE='./siteconfig.inc.php';
$title=$_POST['sitename'];//标题
$webtitle=$_POST['keywords'];//关键字
$beian=$_POST['copyright'];//版权
$banquan=$_POST['beian']; //备案
$tongji=$_POST['tongji']; //统计
$closedweb=$_POST['closedweb']; //关闭网站
$page_all=$_POST['page_all'];//分页
$max_size=$_POST['max_size'];//上传大小
$seo_web=$_POST['seo_web'];//seo关键字
$contents.="<?php\n\tif (!defined('THINK_PATH')) exit();\n\n";
$contents.="\n\n\t return array(\n";
$contents.="'SITENAME'=>'$title',
'KEYWORDS'=>'$webtitle',
'COPYRIGHT'=>'$beian',
'BEIAN'=>'$banquan',
'TONGJI'=>'$tongji',
'CLOSEDWEB'=>'$closedweb',
'PAGE_ALL'=>'$page_all',
'MAX_SIZE'=>'$max_size',
'SEO_WEB'=>'$seo_web',
" ;
$contents.=");";
if(file_put_contents($FILE,$contents)){
$this->success ('编辑成功!');
}else{
$this->error ('bianji!');
}
} 展开
$FILE='./siteconfig.inc.php';
$title=$_POST['sitename'];//标题
$webtitle=$_POST['keywords'];//关键字
$beian=$_POST['copyright'];//版权
$banquan=$_POST['beian']; //备案
$tongji=$_POST['tongji']; //统计
$closedweb=$_POST['closedweb']; //关闭网站
$page_all=$_POST['page_all'];//分页
$max_size=$_POST['max_size'];//上传大小
$seo_web=$_POST['seo_web'];//seo关键字
$contents.="<?php\n\tif (!defined('THINK_PATH')) exit();\n\n";
$contents.="\n\n\t return array(\n";
$contents.="'SITENAME'=>'$title',
'KEYWORDS'=>'$webtitle',
'COPYRIGHT'=>'$beian',
'BEIAN'=>'$banquan',
'TONGJI'=>'$tongji',
'CLOSEDWEB'=>'$closedweb',
'PAGE_ALL'=>'$page_all',
'MAX_SIZE'=>'$max_size',
'SEO_WEB'=>'$seo_web',
" ;
$contents.=");";
if(file_put_contents($FILE,$contents)){
$this->success ('编辑成功!');
}else{
$this->error ('bianji!');
}
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询