我正在尝试创建一个脚本,该脚本在浏览器 URL p 中获取变量,并在列 playername 中查询与变量 p 匹配的任何内容,但它仍然不起作用,任何人都知道我做错了什么,我一直在摆弄这个几个小时..
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Admin Panel</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<link href="http://example.com/assets/css/bootstrap.css" rel="stylesheet">
<link href="http://example.com/assets/css/docs.css" rel="stylesheet">
<link href="http://example.com/assets/js/google-code-prettify/prettify.css" rel="stylesheet">
<center>
<?php
$con = mysql_connect("","","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("log", $con);
$plyr=$_GET["p"];
$result = mysql_query('SELECT * FROM logs_chat WHERE playername="$plyr"');
echo '
<table class="table">
<thead>
<tr>
<th>Time</th>
<th>Player</th>
<th>Message</th>
</tr>
</thead>
<tbody>
';
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['time'] . "</td>";
echo "<td>" . $row['playername'] . "</td>";
echo "<td>" . $row['text'] . "</td>";
echo "</tr>";
}
echo "</table>";
mysql_close($con);
?>
</center>
<script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
<script src="http://example.com/assets/js/jquery.js"></script>
<script src="http://example.com/assets/js/google-code-prettify/prettify.js"></script>
<script src="http://example.com/assets/js/bootstrap-transition.js"></script>
<script src="http://example.com/assets/js/bootstrap-alert.js"></script>
<script src="http://example.com/assets/js/bootstrap-modal.js"></script>
<script src="http://example.com/assets/js/bootstrap-dropdown.js"></script>
<script src="http://example.com/assets/js/bootstrap-scrollspy.js"></script>
<script src="http://example.com/assets/js/bootstrap-tab.js"></script>
<script src="http://example.com/assets/js/bootstrap-tooltip.js"></script>
<script src="http://example.com/assets/js/bootstrap-popover.js"></script>
<script src="http://example.com/assets/js/bootstrap-button.js"></script>
<script src="http://example.com/assets/js/bootstrap-collapse.js"></script>
<script src="http://example.com/assets/js/bootstrap-carousel.js"></script>
<script src="http://example.com/assets/js/bootstrap-typeahead.js"></script>
<script src="http://example.com/assets/js/bootstrap-affix.js"></script>
<script src="http://example.com/assets/js/application.js"></script>
</body>
</html>