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
|
||||||
|
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
<<<<<<< HEAD
|
||||||
$host = 'localhost';
|
$host = 'localhost';
|
||||||
$db = 'cms_simplifie';
|
$db = 'cms_simplifie';
|
||||||
$user = 'root';
|
$user = 'root';
|
||||||
@@ -16,3 +17,20 @@ try {
|
|||||||
} catch (\PDOException $e) {
|
} catch (\PDOException $e) {
|
||||||
die("Erreur de connexion : " . $e->getMessage());
|
die("Erreur de connexion : " . $e->getMessage());
|
||||||
}
|
}
|
||||||
|
=======
|
||||||
|
|
||||||
|
$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());
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
>>>>>>> 69d0e49f6f3e9d2b5b42e092d74bd174b785587d
|
||||||
|
|||||||
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
1
projet_cms
Submodule
1
projet_cms
Submodule
Submodule projet_cms added at 3dd74d2cd8
0
supprimer.php
Executable file
0
supprimer.php
Executable file
Reference in New Issue
Block a user