-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathpost.php
More file actions
165 lines (149 loc) · 2.86 KB
/
post.php
File metadata and controls
165 lines (149 loc) · 2.86 KB
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
<?php include 'header.php';
$qu="SELECT * FROM articles where aid=$r";
$exe=mysqli_query($con,$qu);
$fire=mysqli_fetch_array($exe);
$s="SELECT * FROM articles where category='".$fire['category']."' and aid !=$r";
$er=mysqli_query($con,$s);
$comm="SELECT c.uid,comment FROM comments c inner join articles a on a.aid=c.aid where a.aid=$r";
$res=mysqli_query($con,$comm);
?>
<html lang="en">
<head>
<style>
.btn
{
border-radius:30px;
background-color:#8a2be2;
color:white;
}
.c{
font-size:50px;
color:#8a2be2;
}
.if
{
border-radius:20px;
}
:-ms-input-placeholder
{
color:black;
}
.well1
{
box-shadow:2px 2px grey;
}
.gif
{
height:200px;
width:300px;
}
.title
{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
}
.title h1
{
color:#FFF;
font-size:70px;
}
h1,h4,h2,h3
{
color: #8a2be2;
}
.x
{
padding-right: 10px;
}
.cx
{
width:600px;
height:300px;
}
.d
{
width: 100px;
height: 100px;
}
.aa
{
width: 50px;
height: 50px;
}
.za{
transition: transform .2s;
}
.za:hover
{
transform: scale(1.1);
}
</style>
</head>
<body style="background-color: #f8f8f8">
<br><br>
<div class="col-lg-6 col-lg-offset-1" style="background-color: #ffff">
<img src="<?php echo $fire['articleimg'];?>" class="img-responsive img-rounded cx">
<br><br>
<article>
<h1 class="text-center"><strong><?php echo $fire['head'];?></strong></h1>
<br>
<h4 style="font-family: cursive;"><p><strong><span class="glyphicon glyphicon-tags"></span></strong> <?php echo $fire['category'];?></p></h4>
<br><br>
<p class="text-justify"><?php echo $fire['description'];?></p>
<br><br>
<h2><strong><span class="glyphicon glyphicon-comment"></span> Leave your Comment....</strong></h2>
<br>
<form class="form-group" method="POST" action="db.php?sv=<?php echo $fire['aid'];?>">
<textarea class="form-control" name="abc" rows=4 placeholder="Write Something Here"></textarea>
<br>
<input type="submit" class="btn btn-lg" value="Comment">
</form>
<br><hr>
<h3>Comments :</h3>
<br>
<?php
foreach($res as $row)
{
$r=$row['uid'];
$d="SELECT name from user WHERE uid=$r";
$ra=mysqli_query($con,$d);
?>
<div class="row">
<div class="col-lg-3">
<p><strong><?php foreach($ra as $row1) echo $row1['name']; ?></strong></p>
</div>
<div class="col-lg-9">
<p><strong><?php echo $row['comment']; ?></strong></p>
</div>
</div>
<?php
}
?>
</article>
</div>
<div class="col-lg-4 " style="background-color:#fff; margin-left:10px">
<blockquote><h3>Related Posts :</h3></blockquote>
<br>
<?php
foreach($er as $row)
{?>
<div class="col-lg-12 za well">
<div class="col-lg-3">
<img src="<?php echo $row['articleimg'];?>" class="img-responsive img-rounded aa">
</div>
<div class="col-lg-6">
<a href="db.php?val=<?php echo $row['aid']; ?>"><h5><strong><?php echo $row['head']?></h5></strong></a>
</div>
</div>
<br><hr>
<?php
}
?>
<br>
</div>
<br>
<?php include 'footer.php';?>
</body>
</html>