diff --git a/ajouter.php b/ajouter.php new file mode 100755 index 0000000..e69de29 diff --git a/article.php b/article.php new file mode 100755 index 0000000..e69de29 diff --git a/css/style.css b/css/style.css new file mode 100755 index 0000000..e69de29 diff --git a/dashboard.php b/dashboard.php new file mode 100755 index 0000000..e69de29 diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100755 index 0000000..3fea211 --- /dev/null +++ b/docker-compose.yaml @@ -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 + diff --git a/includes/db.php b/includes/db.php index 08404a4..a535baa 100644 --- a/includes/db.php +++ b/includes/db.php @@ -1,4 +1,5 @@ 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 diff --git a/index.php b/index.php new file mode 100755 index 0000000..8866e5d --- /dev/null +++ b/index.php @@ -0,0 +1,40 @@ + + + + + + + CMS - Accueil + + + +
+

Bienvenue sur mon CMS

+ +
+ +
+
+
+

Article 1

+

Ceci est un exemple d'article pour tester le CMS.

+
+
+

Article 2

+

Encore un autre article de test avec du contenu fictif.

+
+
+
+ + + + diff --git a/login.php b/login.php new file mode 100755 index 0000000..e69de29 diff --git a/modifier.php b/modifier.php new file mode 100755 index 0000000..e69de29 diff --git a/projet_cms b/projet_cms new file mode 160000 index 0000000..3dd74d2 --- /dev/null +++ b/projet_cms @@ -0,0 +1 @@ +Subproject commit 3dd74d2cd8db947144ce5fcb79f212eb1e8084e1 diff --git a/supprimer.php b/supprimer.php new file mode 100755 index 0000000..e69de29 diff --git a/test.php b/test.php new file mode 100644 index 0000000..9ba1a2e --- /dev/null +++ b/test.php @@ -0,0 +1,10 @@ +query("SELECT * FROM utilisateur"); +$users = $stmt->fetchAll(PDO::FETCH_ASSOC); + +echo '
';
+print_r($users);
+echo '
'; +?>