我初学PHP,但是发现了一个问题搞不明白,请大家看看,谢谢了
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
</head><body>
<?php
echo "<input type=\"text\"></input>";
print "aaaaaaaaaaaaaaaaaaaaaaaaa";
?>
</body>
</html>
这样显示出来后按F5刷新,它的显示效果都不会变
但是,当我加一个函数后:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
</head><body>
<?php
function displaypoll($arr)
{
echo "<table>"
while($row = @ mysql_fetch_row($arr))
{
echo "<tr>";
foreach($row as $data)
{
echo "<td>$data["option_name"]<img src=\"./img/leftbar.gif\"><img src=\"./img/mainbar.gif\" height=\"15\" width=\"$data["num"]\"><img src=\"./img/rightbar.gif\"</td>";
}
echo "</tr>";
}
echo "</table>";
}
echo "<input type=\"text\"></input>";
print "aaaaaaaaaaaaaaaaaaaaaaaaa";
?>
</body>
</html>
开始页面显示正常,但是一刷新就什么都没了,但是重新输入地址运行就好了。一刷新就没了,空白页面。
这是为什么阿?