-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathchallenge.php
51 lines (45 loc) · 1.04 KB
/
challenge.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
48
49
50
51
<?php
session_start();
require_once(dirname(__FILE__) . "/conf.php");
if(!$_SESSION['flag'])
header("Location:./");
// sql challenge
$db = mysql_connect($db_url,$db_user,$db_pass);
$con = mysql_select_db ($db_use, $db);
$con = mysql_query('SET NAMES utf8', $db);
$con = mysql_query("select * from challenge", $db);
include 'header.html';
?>
<h1> Challenge </h1>
<hr>
<?php
if(time() < $s_timestamp || time() >= $timestamp){
echo '
<div class="panel panel-info">
<div class="panel-heading">notice</div>
<div class="panel-body">
There is no answer at the time
</div>
</div>';
}
else{
echo'
<h2> Select Challenge </h2>
<table class="table table-bordered">
<tr>
<td>No</td>
<td>Challenge</td>
<td>Point</td>
</tr>';
if($con){
while ($row = mysql_fetch_assoc($con)) {
$id = $row['id'];
$title = $row['title'];
$score = $row['score'];
echo '<tr><td>'.$id.'</td><td><a href="./solve.php?id='.$id.'">'.$title.'</a></td><td>'.$score.'</td></tr>';
}
}
}
?>
</table>
<?php include 'footer.html';?>