edit($id, $title, $content)) { header('Location: view.php?id='.$id); } // 修改失敗 else { header('Location: edit.php?id='.$id); } } // 新增資料 else { // 修改成功 if ($id = $db->insert($title, $content)) { header('Location: view.php?id='.$id); } // 修改失敗 else { header('Location: edit.php'); } }