From dcd777fa64b398067de0242b522736113dd4d0fe Mon Sep 17 00:00:00 2001 From: nathan boileau Date: Fri, 2 Dec 2022 12:01:35 +0100 Subject: [PATCH] VOIR userController pour ce qu'il faut demander au prof --- WEB/Config/Config.php | 2 +- WEB/Controller/UserController.php | 6 ++++-- WEB/Model/scripted.db | 0 WEB/index.php | 11 ++++++++++- 4 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 WEB/Model/scripted.db diff --git a/WEB/Config/Config.php b/WEB/Config/Config.php index 78c5f776..b05111b2 100644 --- a/WEB/Config/Config.php +++ b/WEB/Config/Config.php @@ -14,7 +14,7 @@ $rep = __DIR__ . '/../'; // $password = 'p'; // SQULITE3 -$dsn = './Model/scripted.db'; +$dsn = './../Model/scripted.db'; //Sel de hashage $sel = "JeSuisUnSeldeHashageEtJeSuisUniqueEtTresSecuriseEtJeSuisTresLong"; diff --git a/WEB/Controller/UserController.php b/WEB/Controller/UserController.php index bd6b4c53..638cb5c7 100644 --- a/WEB/Controller/UserController.php +++ b/WEB/Controller/UserController.php @@ -1,5 +1,7 @@ getMessage(); require ($rep.$vues['erreur']); - }catch (Exception $e) + }catch (Exception $e2) { - $error = $e->getMessage(); + $error = $e2->getMessage(); require ($rep.$vues['erreur']); } } diff --git a/WEB/Model/scripted.db b/WEB/Model/scripted.db new file mode 100644 index 00000000..e69de29b diff --git a/WEB/index.php b/WEB/index.php index 6e187b71..432e7589 100644 --- a/WEB/index.php +++ b/WEB/index.php @@ -12,13 +12,22 @@ Autoload::charger(); // $stm->execute(); // $res = $db->query('SELECT * FROM Utilisateur'); -// // Select all the users in the database +// Select all the users in the database // while ($row = $res->fetchArray()) { // echo $row['email'] . " " . $row['password'] . " " . $row['pseudo'] . " " . $row['admin'] . " "; // } echo "test"; +try{ + echo $test; + + var_dump($dsn); $db = new Connection($dsn); + var_dump($db); + +} +catch (Exception $e){ echo $e->getMessage();} +catch (Error $e2){ echo $e2->getMessage();} echo "test2"; $control = new FrontController();