php+mysql简单留言板
add.php
include("conn.php"); if($_POST['submit']){ $sql="insert into message(id,user,title,content,lastdate)"." values ('','$_POST[user]','$_POST[title]','$_POST[content]',now())"; mysql_query($sql); } ?>conn.php
$conn=@ mysql_connect("localhost","root","")or die("连接错误"); mysql_select_db("bbs",$conn); mysql_query("SET NAMES GBK"); ?>list.php
include("conn.php"); ?>标题:=$row[title]?> 用户:=$row[user]?> |
内容:=$row[content]?> |
php+mysql简单留言板