diff --git a/index.php b/index.php index 3fd3378..9769aa2 100644 --- a/index.php +++ b/index.php @@ -27,9 +27,6 @@ exit; } - require 'libs/Parsedown.php'; - $homelink = 'home '; - $action = ''; if (isset($_POST['action'])) $action = $_POST['action']; else if (isset($_GET['action'])) $action = $_GET['action']; @@ -37,6 +34,11 @@ $param = ''; if (isset($_GET['param'])) $param = $_GET['param']; + if (isset($_POST['home'])) + { + $action = 'save'; + } + $content = ''; if ($action == 'save') { @@ -52,6 +54,11 @@ $action = 'open'; $param = $title; + + if (isset($_POST['home'])) + { + header('Location: index.php'); + } } else if ($action == 'delete') { @@ -61,6 +68,7 @@ if ($action == 'preview') { + require 'libs/Parsedown.php'; $title = $_POST['title']; $content = $_POST['content']; $Parsedown = new Parsedown(); @@ -91,8 +99,9 @@ $length = strlen($content); echo '