-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
executable file
·39 lines (33 loc) · 1.22 KB
/
index.php
File metadata and controls
executable file
·39 lines (33 loc) · 1.22 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
<?php include 'lib.php';
htmlHeader("Contests");
htmlBanner();
?>
<!-- We are in the body tag of this html file now! -->
<div class="wrap">
<?php htmlSidebar(); ?>
<div class="content">
<div class="contests">
<?php
$mysqli = connect2mysql();
$res = $mysqli->query("select contest_id, abstract, title from contests;");
for($row_no = 0; $row_no < $res->num_rows; $row_no++){
$res->data_seek($row_no);
$row = $res->fetch_assoc();
$contest_link = "contest.php?id=".$row["contest_id"];
printf("<h2>%s</h2>
<div class=\"contest\">
<div class=\"contest-abstract\">
%s
</div>
</div>
<div class=\"clearFloat\"></div>
<a href=\"%s\" class=\"contest-more\">详情>></a>
<div class=\"clearFloat\"></div>
", $row["title"], $row["abstract"], $contest_link);
}
$mysqli->close();
?>
</div>
</div>
</div>
<?php htmlFooter(); ?>