<!DOCTYPE HTML>
<html>
<head>
<title>统计</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<script type="text/javascript" charset="utf-8" src="ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="ueditor.all.min.js"> </script>
<script type="text/javascript" charset="utf-8" src="lang/zh-cn/zh-cn.js"></script>
</head>
<body>
<h1 style="color:red;margin:0 auto;text-align: center;">计算机1001班统计信息</h1>
<form action="do.php" method="post" name="content">
<script id="editor" type="text/plain" style="width:98%;height:500px;">
<?php
$s = new SaeStorage();
if($s->fileExists('public' , '123.txt')){
echo $s->read('public','123.txt');
}
//echo file_get_contents("./123.txt");
?>
</script>
<input type="submit" name="submit" style="
width: 100%;
line-height: 38px;
text-align: center;
font-weight: bold;
text-shadow:1px 1px 1px #333;
border-radius: 5px;
margin:0 auto;
overflow: hidden;
color: #000;
text-shadow:1px 1px 1px #fff;
border:1px solid #dce1e6;
box-shadow: 0 1px 2px #fff inset,0 -1px 0 #a8abae inset;
background: -webkit-linear-gradient(top,#f2f3f7,#e4e8ec);
background: -moz-linear-gradient(top,#f2f3f7,#e4e8ec);
background: linear-gradient(top,#f2f3f7,#e4e8ec);" value="保存修改">
</form>
<script type="text/javascript">
//实例化编辑器
//建议使用工厂方法getEditor创建和引用编辑器实例,如果在某个闭包下引用该编辑器,直接调用UE.getEditor('editor')就能拿到相关的实例
UE.getEditor('editor');
</script>
</body>
</html>
<?php
if(isset($_POST['editorValue'])){
//file_put_contents("./123.txt",$_POST['editorValue']);
$s = new SaeStorage();
if($s->fileExists('public' , '123.txt'))
$s->delete( 'public' , '123.txt');
$s->write( 'public' , '123.txt',$_POST['editorValue']);
header("Location: http://jisuanji1001.sinaapp.com/");
//echo htmlspecialchars($_POST['editorValue']);
}else{
echo "error";
}
?>