代码拉取完成,页面将自动刷新
<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<?php
// put your code here
var_dump($_POST);
$username=$_POST['username'];
echo "<br>";
$password=$_POST['password'];
$pwd2=$_POST['pwd2'];
$verify=$_POST['verify'];
echo "$username $password $pwd2 $verify<br>";
?>
<?php
//INSERT INTO users(uname,upwd,uemail)VALUES('qwer','123','123456789@12.com');
//$sql="INSERT INTO users(uname,upwd,uemail)VALUES('qwer','123','123456789@12.com');";
//第一步:连接数据库
$link=mysqli_connect("localhost","root","");
mysqli_select_db($link, "nhcar");
mysqli_set_charset($link, "utf8");
echo "<br>";
//第二步:操作数据表
$sql="INSERT INTO users(uname,upwd,uemail)VALUES('$username','$password','123456789@123.com');";
$result=mysqli_query($link,$sql);
//var_dump($result);
//echo "<br>$sql</br>";
echo "<br>";
//exit();
//第三步:处理结果
if($result){
echo "<script>alert('注册成功!');location.href='login.php'</script>";
}else {
echo "<script>alert('注册失败!');location.href='register.php'</script>";
}
?>
</body>
</html>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。