首页 >php教程 >php手册 >php在线文本编辑器

php在线文本编辑器

WBOY
WBOY原创
2016-06-13 10:25:561064浏览

作者:leon0324

function write_file($filename,$contents)
{ if ($fp=fopen($filename,"w"))
{
fwrite($fp,stripslashes($contents));
fclose($fp);
return 1 ;
}
else {return 0; }
};
if ($submitbutton=="完成")
{ $rs=write_file(DownloadFilesa2001-12-15$page,"$test");
echo "$page
";
}
elseif ($action=="page")
{ $content=DownloadFilesa2001-12-15$page;
$fp=fopen($content,"r") or die(Could not open file.);
$contents=fread($fp,filesize($content)) or die(Could not read from file.);
$contents=htmlspecialchars($contents);
fclose($fp);
echo "";


}
else
{ echo "";
}
?>
声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn