首页 > php与数据库 > php留言板程序(适合php初学者)(1/4)

php留言板程序(适合php初学者)(1/4)

这是一款简单的php留言板程序代码,如果你正学习网站开发,这款留言板源码可以帮助哦,希望本文章对你有帮助。
 代码如下 复制代码

<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=gbk" />
<title>所有留言</title>
<link rel="stylesheet" type="text/css教程" href="style.css" media="all" />
</head>

<body>
<a href="add.php">发表留言</a>
<?php
require('common.php');
$result = mysql教程_query("select * from gb_content order by id desc");//查询数据

while ($row = mysql_fetch_array($result, mysql_both)) {// 取一条数据
?>
<table width="700" border="0" cellspacing="0" cellpadding="0" class="tb">
  <tr>
    <td class="bg"><b>[<?php echo htmlentities($row['username'],ent_compat,'utf-8') ?>]</b> 发表于:<?php echo htmlentities($row['insert_time'],ent_compat,'utf-8') ?></td>
  </tr>
  <tr>
    <td><?php echo htmlentities($row['content'],ent_compat,'utf-8') ?></td>
  </tr>
  <tr>
    <td align="right"><a href="edit.php?id=<?php echo $row['id'] ?>">修改</a> <a href="delete.php?id=<?php echo $row['id'] ?>">删除</a></td>
  </tr>
</table>
<?php
}

mysql_free_result($result);

?>
</body>
</html>

 

本文地址:http://www.phprm.com/database/34097.html

转载随意,但请附上文章地址:-)

标签:none

发表留言