diff --git a/skel/pages/add().php b/skel/pages/add().php index f810ab1..74ca427 100644 --- a/skel/pages/add().php +++ b/skel/pages/add().php @@ -1,12 +1,18 @@ - -$ = DB::selectPairs('select ``,`` from ``'); + +$ = DB::selectPairs('select ``,`` from ``'); if ($_SERVER['REQUEST_METHOD']=='POST') { $data = $_POST; - - if (!isset($[$data['']['']])) $errors['[]']=' not found'; + + if (!isset($[$data['']['']])) $errors['[]']=' not found'; + + if (!$data['']['']) $errors['[]']=' must be filled'; + + + if (!$data['']['']) $data['']['']=null; + if (!isset($errors)) { $id = DB::insert('INSERT INTO `` () VALUES ()', ); if ($id) { diff --git a/skel/pages/add(admin).phtml b/skel/pages/add(admin).phtml index 258f81b..293ade5 100644 --- a/skel/pages/add(admin).phtml +++ b/skel/pages/add(admin).phtml @@ -2,21 +2,21 @@