2 Star 1 Fork 1

ADA/nanhuacar

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
adduser.php 1.53 KB
一键复制 编辑 原始数据 按行查看 历史
<!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>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yxh0102/nanhuacar.git
git@gitee.com:yxh0102/nanhuacar.git
yxh0102
nanhuacar
nanhuacar
master

搜索帮助