新手...小白在此
学了三天了,跟着视频写了个简单的,但是......
add.php文件:
$conn=mysql_connect("localhost","root","123");
mysql_select_db("test",$conn);
if($_POST['send'])
{
if(mysql_query("insert into totest(username,usertitle,usercontent,date)values('$_POST[user]','$_POST[title]','$_POST[content]',now())",$conn))
{
echo "发表成功";
}
else echo("Mysql error:".mysql_error());
}
mysql_close();
?>
Html文件: