PHP留言板(实例)
lyb.htm
lyb.php
@$name=$_POST["name"];
@$lb=$_POST["lb"];
@$qq=$_POST["qq"];
@$email=$_POST["email"];
@$phone=$_POST["phone"];
@$content=$_POST["content"];
$conn=mysql_connect("localhost","root","123");
if($content!="")
{
$conn=mysql_connect("localhost","root","123");
mysql_select_db("lyb");
// mysql_query("set names gbk");
$sql="insert into ly(name,lb,qq,email,phone,content) values('{$name}','{$lb}','{$qq}','{$email}','{$phone}','{$content}')";
//var_dump($sql);
//die();
$rs=mysql_query($sql);
$row=mysql_affected_rows($conn);
if ($row>0)
{
echo "";
}
else
{
echo "";
}
}
?>