-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
35 lines (22 loc) · 762 Bytes
/
index.php
File metadata and controls
35 lines (22 loc) · 762 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
require('inc/functions.php');
require('inc/database.php');
checkConnection();
$title= 'Accueil - MonBlog.fr';
$articles = getAllArticlesByStatus($pdo);
include('inc/header.php'); ?>
<div id="all">
<?php foreach($articles as $article) { ?>
<div class="wrap">
<h2> <?= $article['title'];?></h2>
<p class="brown">Auteur: <?=!empty($article['pseudo'])? $article['pseudo'] : 'Not defined'?></p>
<div class="article">
<p> Déscription: <?= $article['description'];?></p>
<p class="pub"> Publié le: <?= date("Y/m/d", strtotime($article['published_at']));?></p>
</div>
<button class="voir"><a href="article.php?id=<?=$article['id']; ?>">Voir plus</a></button>
</div>
<?php } ?>
</div>
<?php
include('inc/footer.php');