刷新网页的内容

时间:2017-03-09 00:15:20

标签: php html5

我正在尝试从数据库表中检索内容并使用php脚本显示它们。我成功检索并显示了内容,并使用元标记每5秒刷新一次内容。页面还不令人耳目一新。你能帮助我吗?在这里,我附上了我的代码:

<html>
<head>
<meta http-eqiv="refresh" content="2">
</head>
<body>
<?php
session_start();
$_SESSION['username'];
$con=mysqli_connect("localhost","root","","oracle");
$result=mysqli_query($con,"SELECT * from message order by timestamp DESC");
while($row=mysqli_fetch_row($result))
{
echo "<font color='red'><b><i>" .$row['2']."
</i></b></font> &nbsp;says:             <font color='green'><b><i>" 
. $row['0']. "</i></b></font>&nbsp;at:" . 
$row['1']. "<br>";
}
?>
</body>
</html>

1 个答案:

答案 0 :(得分:0)

您的代码中存在拼写错误:

http-equiv="refresh"