<?phpheader("Content-type:text/html;charset=utf-8");#接受前端信息$stuName=$_POST['stuName'];$stupwd=$_POST['stupwd'];#创建1连接对象$conn=mysql_connect('localhost','root','root');if($conn){echo'连接成功';#创建库mysql_select_db('day2108');$result=mysql_query("select * from student where stuName='$stuName' and stupwd=$stupwd",$conn);if(mysql_num_rows($result)==0){mysql_query("insert into student ('$stuName',$stupwd)",$conn);echo'注册成功';}else{echo'亲,这个已经有了奥';}}?>