forked from 710leo/ZVulDrill
-
Notifications
You must be signed in to change notification settings - Fork 0
/
message.php
44 lines (40 loc) · 1.05 KB
/
message.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
<?php
require_once('sys/config.php');
require_once('header.php');
$query = "SELECT * FROM comment ORDER BY comment_id";
$data = mysqli_query($dbc,$query) or die('Error!!');
mysqli_close($dbc);
?>
<div class="bs-example table-responsive">
<table class="table table-striped table-hover ">
<tr>
<th>#</th>
<th>Column heading</th>
</tr>
<?php
while($com = mysqli_fetch_array($data)) {
//净化输出变量
$html['username'] = htmlspecialchars($com['user_name']);
$html['comment_text'] = htmlspecialchars($com['comment_text']);
echo '<tr>';
echo '<td>'.$html['username'].'</td>';
echo '<td>'.$html['comment_text'].'</td>';
echo '</tr>';
}
?>
</table>
</div>
<?php
if (isset($_SESSION['username']))
{?>
<form action="messageSub.php" method="post" name="message">
<div class="col-lg-10">
<textarea class="form-control" rows="3" id="textArea" name="message"></textarea>
</div>
<input type="submit" name="submit" value="留言"/>
<a href="user/user.php">返回</a><br /><br /><br /><br /><br />
</form>
<?php
}
require_once('footer.php');
?>