-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharticle.php
50 lines (40 loc) · 1.6 KB
/
article.php
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
session_start();
if ( !isset( $_SESSION['id'] ) ) {
header( 'Location: login.php');
}
if (!isset($_GET['id'])){
header( 'Location: blog.php');
}
require_once 'inc/functions.php';
$article = bdd_select('SELECT id, titre, contenu, date, url FROM article WHERE id=' . $_GET['id']);
?>
<!DOCTYPE html>
<html lang="fr">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Content-Type" content="text/html">
<title>Le Motel</title>
<meta charset="UTF-8">
<meta keyword="">
<meta description="">
<link rel="icon" type="image/png" href="img/favicon.png" />
<link href="https://fonts.googleapis.com/css?family=Montserrat:300,400,500" rel="stylesheet">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="css/blog.css">
</head>
<body>
<nav>
<form method="POST" action="deconnexion.php"><a href="blog.php"><h1><i class="fas fa-chevron-left"></i>NEWS</h1></a><button type="submit">DECONNEXION</button></form>
</nav>
<section>
<article>
<img src="img/<?php echo $article[0]['url'] ?>"/>
<h2 id="titre"> <?php echo $article[0]['titre'] ?></h2>
<p><?php echo $article[0]['contenu'] ?></p>
<time datetime="<?php echo $article[0]['date'] ?>"><?php echo date("d/m/Y", strtotime($article[0]['date'])) ?></time>
</article>
</section>
</body>
</html>