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);