新手...小白在此
学了三天了,跟着视频写了个简单的,但是......
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文件:
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号