-
Notifications
You must be signed in to change notification settings - Fork 3
/
notice.php
38 lines (34 loc) · 860 Bytes
/
notice.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
<?php
session_start();
require_once(dirname(__FILE__) . "/conf.php");
include 'header.html';
?>
<h1> Announcement </h1>
<hr>
<?php
$con = mysql_connect($db_url, $db_user, $db_pass);
$result = mysql_select_db($db_use, $con);
$result = mysql_query('SET NAMES utf8', $con);
$result = mysql_query("SELECT title, time FROM notice order by id desc", $con);
?>
<table class="table table-bordered">
<thead>
<tr>
<th>Article</th>
<th>Date</th>
</tr>
</thead>
<tbody>
<?php
while ($data = mysql_fetch_array($result)) {
echo "<tr>";
echo "<td>";echo "<a href="; echo "./read.php?title="; echo urlencode($data["title"]); echo ">" .$data["title"]. "</a>"; echo "</td>";
echo "<td>";echo $data["time"]; echo "</td>";
echo "</tr>";
}
?>
</table>
<?php
$con = mysql_close($con);
?>
<?php include 'footer.html';?>