-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainPage.php
47 lines (43 loc) · 1.12 KB
/
MainPage.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
<?php
include_once 'dbConfig.php';
$query = $con->query("SELECT * FROM blog WHERE approved='1'");
$i=0;
$no0fBlogs=0;
if ($query->num_rows > 0)
{
while($row = $query->fetch_assoc())
{
$no0fBlogs++;
$id[$i] = $row['id'];
$title[$i] = $row['title'];
$name[$i] = $row['member_name'];
$content[$i] = $row['content'];
$created[$i] = $row['created'];
$i++;
}
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Robotics Club MNNIT</title>
<link rel="stylesheet" href="mainpage_styles.css">
</head>
<body>
<h1>Blogs</h1>
<?php
for($i=0;$i<$no0fBlogs;$i++)
{
echo '<div class="blog" id="id',$i,'">',
'<h2>',$title[$i],'</h2>
<i>written by </i>',$name[$i],
'<br>',$created[$i],
'<div class="content">',$content[$i],
'</div>
</div><br>';
}
?>
</body>
</html>