时间:2021-07-01 10:21:17 帮助过:7人阅读
function alert_go($msg,$url){ echo "";}$username=$_POST['username'];$pass=$_POST['pass'];$pass2=$_POST['pass2'];$email=$_POST['email'];if(!filled_out($_POST)){ echo "信息不全,不能录入!"; exit;}if(!valid_email($email)){ echo "邮箱格式不正确,请重新检查!"; exit;}if($pass != $pass2){ echo "两次密码不一致,请重新输入"; exit;}if((strlen($pass)<6) || (strlen($pass)>16)){ echo "密码长度不正确,请重新输入"; exit;}//echo "注册成功"; @ $db=new mysqli('localhost','root','020310','demo'); if(mysqli_connect_errno()) { echo "数据库连接错误,请检查后重新连接"; exit; } $query="insert into user(username,password,email) values(?,?,?)"; $stmt=$db->prepare($query); $stmt->bind_param('sss',$username,$pass,$email); $ss=$stmt->execute(); if($ss) { alert_go('注册成功!','http://baidu.com'); //header('Location: http://localhost/login/login.html'); }else{ alert_go('注册失败!','http://baidu.com'); } 为什么最后跳转不到百度页面啊