From 2a8971d2cbca4048731bf3f0eab9034f59fb2423 Mon Sep 17 00:00:00 2001 From: Yuan Chiu Date: Fri, 10 Apr 2020 10:15:48 +0800 Subject: [PATCH] =?UTF-8?q?Fix=20=E5=84=B2=E5=AD=98=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E7=9A=84=E6=8F=9B=E8=A1=8C=E8=99=95=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/save.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/save.php b/htdocs/save.php index c835406..4e662b2 100644 --- a/htdocs/save.php +++ b/htdocs/save.php @@ -20,7 +20,7 @@ if (!empty($_POST["id"]) && !empty($_POST["delete"]) && $_POST["delete"] == "tru elseif (!empty($_POST['id'])) { $id = $_POST['id']; $title = $_POST['title']; - $content = $_POST['content']; + $content = nl2br($_POST['content']); // 修改成功 if ($db->edit($id, $title, $content)) { header('Location: view.php?id='.$id); @@ -33,7 +33,7 @@ elseif (!empty($_POST['id'])) { // 新增資料 else { $title = $_POST['title']; - $content = $_POST['content']; + $content = nl2br($_POST['content']); // 修改成功 if ($id = $db->insert($title, $content)) { header('Location: view.php?id='.$id);