-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patharticle.php
81 lines (75 loc) · 1.98 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?php
require_once('config.php');
if (isset($_POST["comment"])){
addComment($_POST["email"],$_POST["comment"],$_GET["id"]);
}
$posts = getPosts("where id=".$_GET["id"]);
$comments = getComments("where post_id=".$_GET["id"]);
foreach ($posts as $post){
//Recupere le post
}
?>
<html>
<head>
<link rel="stylesheet" href="css/bootstrap.min.css" />
<link rel="stylesheet" href="css/app.css" />
<link rel="stylesheet" href="css/styles.css" />
<link rel="stylesheet" href="css/font-awesome.min.css" />
<title id="title"><?php echo $post["title"];?></title>
<script type="text/javascript" src="js/jquery.min.js"></script>
</head>
<body>
<div class="container" style="padding-top:10px">
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading">
<h1 id="h1"><?php echo $post["title"];?></h1>
</div>
<div class="panel-body">
<article>
<?php echo $post["content"];?>
</article>
<div>
<h2>Commentaires</h2>
<form method='post' action="article.php?id=<?php echo $post["id"];?>">
<table>
<tr>
<td>
Email:
</td>
<td>
<input type="text" name="email" value="" required />
</td>
</tr>
<tr>
<td>Commentaire</td>
<td><textarea rows="4" cols="60" name="comment"></textarea>
</td>
</tr>
<tr>
<td>
</td>
<td >
<input type="submit" class="btn btn-primary" value="Envoyer" />
<td>
<tr>
</table>
</form>
<ul>
<?php
foreach ($comments as $comment){
?>
<li><?php echo $comment["email"];?>:<br/><?php echo $comment["content"];?></li>
<?php
}
?>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>