} elseif ($method === "POST") { general::handleLogin(); } break; case "register": if ($method === "GET") { general::displayRegisterForm(); } elseif ($method === "POST") { general::handleRegister(); } break; case "registerOK": general::displayRegisterOKPage(); break; case "logout": general::logout(); break; } class general { public static function displayLoginForm($vars = array()) { global $smarty; $vars = self::ext($vars, array("error" => "false", "formAction" => "/general.php?action=login")); $smarty->assign($vars); $smarty->display("login.tpl.html"); } public static function handleLogin() { //login user or display loginForm with errors $username = $_POST["username"];