diff --git a/public/blog/index.php b/public/blog/index.php index b65c873..25d0667 100755 --- a/public/blog/index.php +++ b/public/blog/index.php @@ -33,7 +33,7 @@ 2025.07.30 - 新增post、模块,这是第一篇文章 + 新增post、模块,这是第一篇文章 @@ -77,18 +77,33 @@ -
- +
+
+
+
- - - #js_date{ - color: rgb(55, 0, 255); - font-size: 200%; - } - \ No newline at end of file + + + \ No newline at end of file diff --git a/public/blog/master/index.php b/public/blog/master/index.php new file mode 100755 index 0000000..18fede9 --- /dev/null +++ b/public/blog/master/index.php @@ -0,0 +1,13 @@ +master + + +
+ +
+
+ +
\ No newline at end of file diff --git a/public/blog/master/index.txt b/public/blog/master/index.txt new file mode 100755 index 0000000..e11442d --- /dev/null +++ b/public/blog/master/index.txt @@ -0,0 +1 @@ +{2025/07/30};{"第一篇文章"} \ No newline at end of file diff --git a/public/blog/master/post_data.php b/public/blog/master/post_data.php new file mode 100755 index 0000000..6ba8899 --- /dev/null +++ b/public/blog/master/post_data.php @@ -0,0 +1,34 @@ + 标签的 name 属性 +if (isset($_POST['data']) && !empty($_POST['data'])) { + + // 自动获取当前日期和时间 + $date = date('Y/m/d'); + + // 获取你在网页输入框中写的数据 + $data = $_POST['data']; + + // 3. 构建完整的单行内容,格式为 {日期};{数据},并以换行符 \n 结尾 + $content = "{" . $date . "};" . "{" . '"' . $data . '"' . "}" . "\n"; + + // 4. 将内容追加到文件末尾 + $result = file_put_contents($file, $content, FILE_APPEND | LOCK_EX); + + // 5. 检查是否写入成功并给出反馈 + if ($result !== false) { + echo "数据已成功写入到 " . $file . " 文件。你可以 返回。"; + } else { + echo "写入文件失败,请检查文件权限。"; + } + +} else { + // 如果没有接收到数据,返回错误信息 + echo "没有接收到任何数据。请 返回 重新输入。"; +} + +?> \ No newline at end of file diff --git a/public/blog/read_file.php b/public/blog/read_file.php new file mode 100644 index 0000000..6aebf72 --- /dev/null +++ b/public/blog/read_file.php @@ -0,0 +1,33 @@ +
"; + echo "" . $data . "\n"; + echo "" . $title . "\n"; + echo " 跳转页面"; + //echo '链接 (URL): 链接'; + } + } + + //输出内容 + //echo "文件 '{$file}' 的内容是:

\n\n"; + //echo $content; + } else { + echo "错误: 文件 '$file' 不存在 "; + } +?> \ No newline at end of file