<meta charset="utf-8"> <?php $db_url= '127.0.0.1'; $db_name = 'user'; $db_account = 'root'; $db_pwd = '123456'; $con = new mysqli($db_url,$db_account,$db_pwd,$db_name); if($con->connect_error) { die("数据库连接失败:" . $con->connect_error); } $topic=$_POST['topic']; $texttext=$_POST['texttext']; $sql = "insert into talktalk (topic,texttext) values ('{$topic}','{$texttext}')"; $result = $con->query($sql); if(!$result) { die('发表失败!'); }else{ echo"发表成功!<a href='talk.php'>返回论坛</a>"; } ?>
尧叔
慕的地6079101
天使之翼死神之镰
错过了年华
雪颲
Asgardusk