premier commit
This commit is contained in:
0
ajouter.php
Executable file
0
ajouter.php
Executable file
0
article.php
Executable file
0
article.php
Executable file
0
css/style.css
Executable file
0
css/style.css
Executable file
0
dashboard.php
Executable file
0
dashboard.php
Executable file
25
docker-compose.yaml
Executable file
25
docker-compose.yaml
Executable file
@@ -0,0 +1,25 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
web:
|
||||
image: php:8.2-apache
|
||||
container_name: cms-web
|
||||
ports:
|
||||
- "8080:80"
|
||||
volumes:
|
||||
- ./public:/var/www/html
|
||||
- ./includes:/var/www/html/includes
|
||||
depends_on:
|
||||
- db
|
||||
|
||||
db:
|
||||
image: mysql:latest
|
||||
container_name: cms-db
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: root
|
||||
MYSQL_DATABASE: cms_simplifie
|
||||
ports:
|
||||
- "3306:3306"
|
||||
volumes:
|
||||
- db_data:/var/lib/mysql
|
||||
|
||||
16
includes/db.php
Executable file
16
includes/db.php
Executable file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
$host = 'db';
|
||||
$dbname = 'cms_simplifie';
|
||||
$user = 'root';
|
||||
$pass = 'root';
|
||||
|
||||
try {
|
||||
|
||||
$pdo = new PDO("mysql:host=$host;dbname=$dbname;charset=utf8", $user, $pass);
|
||||
|
||||
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
} catch (PDOException $e) {
|
||||
die("Erreur de connexion : " . $e->getMessage());
|
||||
}
|
||||
?>
|
||||
0
includes/footer.php
Executable file
0
includes/footer.php
Executable file
0
includes/header.php
Executable file
0
includes/header.php
Executable file
40
index.php
Executable file
40
index.php
Executable file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
require_once 'includes/db.php';
|
||||
echo "Connexion réussie à la base de données !";
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>CMS - Accueil</title>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<h1>Bienvenue sur mon CMS</h1>
|
||||
<nav>
|
||||
<a href="index.html">Accueil</a>
|
||||
<a href="add.html">Ajouter un article</a>
|
||||
<a href="login.html">Connexion</a>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<main>
|
||||
<section class="articles">
|
||||
<article>
|
||||
<h2>Article 1</h2>
|
||||
<p>Ceci est un exemple d'article pour tester le CMS.</p>
|
||||
</article>
|
||||
<article>
|
||||
<h2>Article 2</h2>
|
||||
<p>Encore un autre article de test avec du contenu fictif.</p>
|
||||
</article>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<footer>
|
||||
<p>© 2025 Mini CMS. Tous droits réservés.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
0
modifier.php
Executable file
0
modifier.php
Executable file
0
supprimer.php
Executable file
0
supprimer.php
Executable file
Reference in New Issue
Block a user