diff --git a/WEB/Controller/UserController.php b/WEB/Controller/UserController.php index f85d4941..29dd807d 100644 --- a/WEB/Controller/UserController.php +++ b/WEB/Controller/UserController.php @@ -5,12 +5,11 @@ class UserController private Connection $con; function __construct() { - global $dsn; - echo "userController"; - $this->con=new Connection ($dsn); - echo "USconection"; try{ - global $rep, $vues, $error; + global $dsn, $rep, $vues, $error; + echo "userController"; + $this->con=new Connection ($dsn); + echo "USconection"; $action=$_REQUEST['action']; switch($action) { case NULL: @@ -39,6 +38,10 @@ class UserController break; } } catch (PDOException $e) + { + $error = $e->getMessage(); + require ($rep.$vues['erreur']); + }catch (Exception $e) { $error = $e->getMessage(); require ($rep.$vues['erreur']); diff --git a/WEB/index.php b/WEB/index.php index e759681d..a9704cb1 100644 --- a/WEB/index.php +++ b/WEB/index.php @@ -18,8 +18,7 @@ Autoload::charger(); // } echo "test"; -require ($rep.$vues['main']); -// $control = new FrontController(); +$control = new FrontController(); //session_regenerate_id(true);