-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
71 lines (70 loc) · 2.1 KB
/
index.php
File metadata and controls
71 lines (70 loc) · 2.1 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
<?php
session_start();
$pw=getenv('MySQLrootPW');
$conn=mysqli_connect('127.0.0.1','root', $pw,'eumppedb');
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Eumppe</title>
<link rel="stylesheet" href="./css/main.css" type="text/css">
</head>
<body>
<div>
<header>
<section class="home-header wilson">
<a href="/index.php">
<img class="home-header-icon" src="/img/eumppe.png"/>
</a>
<div class="home-header-right">
<div class="home-header-bottom">
<ul class="home-header-bottom-button">
<li><a href="/pages/article-list.php?forum=1">Notice</a></li>
<li><a href="/pages/article-list.php?forum=2">Community</a></li>
<li><a href="/pages/article-list.php?forum=3">Random</a></li>
<li><a href="/pages/article-list.php?forum=4">Questions</a></li>
</ul>
</div>
<div class="home-header-upper">
<form class="search" action="/pages/search.php">
<input class="search-index" type="text" name="search-keyword">
<input type="image" src="/img/search.png" alt="검색" style="width:1.5rem;height:1.5rem;">
</form>
<div class="home-header-upper-auth">
<?php
if ($_SESSION==null){
echo '<a href="/pages/login.php">login</a>
<a href="/pages/signup.php">sign up</a>';
}else{
echo '<a href="/redi/logout.php">logout</a>';
}
?>
</div>
</div>
</div>
</section>
</header>
<main>
<div class="home-banner wilson">
<img src='/img/banner1.png' alt="banner1">
</div>
<section class="home-recentnews wilson">
<h2>Recent Articles</h2>
<ul>
<?php
$sql="SELECT * FROM articles ORDER BY times DESC LIMIT 5";
$result=mysqli_query($conn,$sql);
while($row=mysqli_fetch_array($result)){
echo("<li><a href='/pages/show-article.php?idx=".$row['idx']."'>".$row['times']." | ".$row['title']."</a></li>");
}
?>
</ul>
</section>
</main>
</div>
<footer>
</footer>
</body>
</html>