From 20144d413d928919a8134a7d5f5f657bca2a1895 Mon Sep 17 00:00:00 2001 From: abdul Date: Sun, 2 Nov 2025 22:15:46 +0000 Subject: [PATCH] =?UTF-8?q?T=C3=A9l=C3=A9verser=20les=20fichiers=20vers=20?= =?UTF-8?q?"src"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fichiers php de src --- src/article.php | 31 +++++++++++++++++++++++++++++++ src/index.php | 24 ++++++++++++++++++++++++ src/test_connection.php | 3 +++ src/test_pdo.php | 3 +++ 4 files changed, 61 insertions(+) create mode 100644 src/article.php create mode 100644 src/index.php create mode 100644 src/test_connection.php create mode 100644 src/test_pdo.php diff --git a/src/article.php b/src/article.php new file mode 100644 index 0000000..bc5c5c5 --- /dev/null +++ b/src/article.php @@ -0,0 +1,31 @@ +404 - Article non trouvé"; + exit; +} + +$id = $_GET['id']; +$stmt = $pdo->prepare("SELECT * FROM articles WHERE id = ?"); +$stmt->execute([$id]); +$article = $stmt->fetch(PDO::FETCH_ASSOC); + +if (!$article) { + header("HTTP/1.0 404 Not Found"); + echo "

404 - Article non trouvé

"; + exit; +} +?> + +
+
+

+

+
+
+ + \ No newline at end of file diff --git a/src/index.php b/src/index.php new file mode 100644 index 0000000..61a8ecd --- /dev/null +++ b/src/index.php @@ -0,0 +1,24 @@ +query("SELECT * FROM articles ORDER BY date_creation DESC LIMIT 10"); +$articles = $stmt->fetchAll(PDO::FETCH_ASSOC); +?> + +
+

Derniers articles

+ +

Connexion Admin

+ + +
+

+

...

+
+ +
+ + \ No newline at end of file diff --git a/src/test_connection.php b/src/test_connection.php new file mode 100644 index 0000000..bee8e12 --- /dev/null +++ b/src/test_connection.php @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/src/test_pdo.php b/src/test_pdo.php new file mode 100644 index 0000000..d2b25e4 --- /dev/null +++ b/src/test_pdo.php @@ -0,0 +1,3 @@ + \ No newline at end of file