-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfullarticle.php
83 lines (63 loc) · 1.69 KB
/
fullarticle.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
82
83
<?php include 'scripts/dbconn.php';?>
<?php include 'includes/links.php';?>
<?php include 'scripts/likearticle.php';?>
<body>
<!--header-->
<?php include 'includes/header.php';?>
<!--posts-->
<main>
<!--reading full article-->
<div class="full-article">
<div class="back">
<a href="blog.php">Back</a>
</div>
<?php
if(isset($_GET['id'])){
$ID=$_GET['id'];
$userReq=mysqli_query($conn,"SELECT * from articles where art_id=$ID");
if($row=mySQLi_fetch_array($userReq)){
$authid= $row['user_id'];
$artimg=$row['art_image'];
$title=$row['title'];
$artcont = $row['art_content'];
$date=$row['created'];
}
}
?>
<!--title-->
<div class="title">
<h3><?php echo $title; ?></h3>
</div>
<!--image-->
<div class="blog-img">
<img src="<?php echo $artimg; ?>" alt="blog image">
</div>
<div class="blog-content">
<p><?php echo $artcont; ?></p>
</div>
<?php
$author=mySQLi_query($conn,"select * from users where user_id=$authid");
if($row=mysqli_fetch_array($author)){
$authfn=$row['fname'];
$authln=$row['lname'];
$authpic=$row['profile_image'];
}
?>
<div class="credit">
<p>Written By</p>
<div class="aut">
<img src="<?php echo $authpic; ?>" alt="author">
<p class="name"><?php echo $authfn. ' ' .$authln; ?></p>
</div>
</div>
<div class="like">
<form method="POST">
<input type="submit" value="like" name="likeart">
<input type="hidden" name="autid" value="<?php echo $authid ?>">
<input type="hidden" name="sender" value="<?php echo $userId ?>">
<input type="hidden" name="artid" value="<?php echo $ID; ?>">
</form>
</div>
</div>
</main>
<?php include 'includes/footer.php';?>