public function createform() { if (isset($_POST) && !empty($_POST)) { $proj_name = $_POST['proj_name']; if (!empty($_POST['proj_name'])) { $project_exist = Project::findByattr($proj_name); if ($project_exist) { $msg = 0; $this->redirecturl('pages', 'home', '0'); } else { $project = Project::insert($proj_name); if ($project == true) { $msg = 1; $this->redirecturl('pages', 'home', '1'); } // else{ // $_SESSION['success']=0; // require_once('views/pages/home.php'); // } } } } else { $msg = 0; $this->redirecturl('pages', 'home', '0'); } }