-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharticle.php
More file actions
41 lines (30 loc) · 849 Bytes
/
article.php
File metadata and controls
41 lines (30 loc) · 849 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
36
37
38
39
40
41
<?php
include_once('includes/connection.php');
include_once('includes/article.php');
$article = new Article;
if (isset($_GET['id'])) {
$id = $_GET['id'];
$data = $article->fetch_data($id);
//print_r($data);
?>
<?php include_once('includes/header.php'); ?>
<div class="container">
<!-- <a href="." id="logo"><h1>CMS</h1></a> -->
<h1><?php echo $data['article_title']?></h1>
<small>
Published :
<i class="fas fa-pencil-alt"></i>
<?php echo date('jS Y, l', $data['article_timestamp']);?>
<i class="far fa-clock"></i>
<?php echo date('g:i A', $data['article_timestamp']);?>
</small>
<p><?php echo nl2br($data['article_content']);?></p>
<a href=".">← Back</a>
</div>
<?php include_once('includes/footer.php'); ?>
<?php
} else {
header('Location : index.php');
exit();
}
?>