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