commit 009e1d0bcceb0b853ee6bdf29f6b203430430b36 Author: klnsancho Date: Mon Nov 17 19:14:38 2025 +0000 Téléverser les fichiers vers "article-index-css" diff --git a/article-index-css/Instructions.txt b/article-index-css/Instructions.txt new file mode 100644 index 0000000..f8bebab --- /dev/null +++ b/article-index-css/Instructions.txt @@ -0,0 +1,14 @@ +INSTRUCTIONS POUR LANCER LE PROJET CMS SIMPLIFIE + +1. Installer XAMPP sur le PC (Apache + MySQL). +2. Démarrer Apache et MySQL dans XAMPP. +3. Copier le dossier "cms_simplifie" dans : C:\xampp\htdocs\ +4. Ouvrir un navigateur et aller sur : http://localhost/phpmyadmin +5. Créer une base de données : cms_simplifie +6. Dans phpMyAdmin, importer le fichier "database.sql" fourni. +7. Lancer le site : + Page publique : http://localhost/cms_simplifie/ + Page administrateur : http://localhost/cms_simplifie/admin/connexion.php +8. Identifiants administrateur : + Login : admin + Mot de passe : admin123 diff --git a/article-index-css/article.php b/article-index-css/article.php new file mode 100644 index 0000000..55ef887 --- /dev/null +++ b/article-index-css/article.php @@ -0,0 +1,22 @@ +Erreur 404 - Article introuvable"); +} + +$id = (int) $_GET['id']; +$stmt = $pdo->prepare("SELECT * FROM articles WHERE id = ?"); +$stmt->execute([$id]); +$article = $stmt->fetch(); + +if (!$article) { + echo "

Erreur 404 - Article introuvable

"; +} else { + echo "

" . htmlspecialchars($article['titre']) . "

"; + echo "

" . nl2br(htmlspecialchars($article['contenu'])) . "

"; +} + +include 'includes/footer.php'; +?> diff --git a/article-index-css/database.sql b/article-index-css/database.sql new file mode 100644 index 0000000..ba68d90 --- /dev/null +++ b/article-index-css/database.sql @@ -0,0 +1,18 @@ +CREATE DATABASE IF NOT EXISTS cms_simplifie; +USE cms_simplifie; + +CREATE TABLE utilisateur ( + id INT AUTO_INCREMENT PRIMARY KEY, + login VARCHAR(50), + password VARCHAR(255) +); + +CREATE TABLE articles ( + id INT AUTO_INCREMENT PRIMARY KEY, + titre VARCHAR(255), + contenu TEXT, + date_creation DATETIME +); + +INSERT INTO utilisateur (login, password) +VALUES ('admin', '$2y$10$Z2Wxdqeh98H8qDdsK4QvGeZZPaAulxGZ2gUxO4ePgQ1Qsh9TY6Z.C'); diff --git a/article-index-css/index.php b/article-index-css/index.php new file mode 100644 index 0000000..e92f547 --- /dev/null +++ b/article-index-css/index.php @@ -0,0 +1,22 @@ +query($sql); +$articles = $stmt->fetchAll(PDO::FETCH_ASSOC); +?> + +

Derniers articles

+ + +

Aucun article pour le moment.

+ + +

+

...

+
+ + + + diff --git a/article-index-css/style.css b/article-index-css/style.css new file mode 100644 index 0000000..f8a0691 --- /dev/null +++ b/article-index-css/style.css @@ -0,0 +1,90 @@ +/* === STYLE GLOBAL === */ +body { + font-family: Arial, sans-serif; + background-color: #1111b9; + margin: 0; + padding: 0; + color: #333; +} + +/* === HEADER & TITRES === */ +h1, h2, h3 { + text-align: center; + color: #2c3e50; +} + +/* === FORMULAIRES === */ +form { + max-width: 400px; + margin: 20px auto; + padding: 70px; + background-color: white; + border-radius: 30px; +} + +input[type="text"], input[type="password"], textarea { + width: 100%; + padding: 10px; + margin-top: 5px; + border: 1px solid #ccc; + border-radius: 4px; +} + +button { + background-color: #a7c2d3; + color: rgb(214, 89, 89); + border: none; + padding: 10px 15px; + border-radius: 5px; + cursor: pointer; + font-weight: bold; +} + +button:hover { + background-color: #a11d1d; +} + +/* === TABLEAUX === */ +table { + border-collapse: collapse; + width: 90%; + margin: 20px auto; + background-color: white; + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); +} + +th, td { + border: 1px solid #ddd; + padding: 10px; + text-align: left; +} + +th { + background-color: #792020; + color: rgb(163, 31, 31); +} + +/* === LIENS === */ +a { + text-decoration: none; + color: #bd1212; + font-weight: bold; +} + +a:hover { + text-decoration: underline; +} + +/* === MESSAGES === */ +p { + text-align: center; + font-weight: bold; +} + +p[style*="color:green"] { + color: #27ae60 !important; +} + +p[style*="color:red"] { + color: #e74c3c !important; +}