register
来源:互联网 发布:大家都用阿里云做什么 编辑:程序博客网 时间:2024/04/30 10:12
register.html
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Register</title></head><body><h1>用户注册</h1><form method="POST" action="register.php">用 户 名:<input type="text" name="username" maxlength="30" size="30"></br></br>用户密码:<input type="password" name="password1" maxlength="30" size="30"></br></br>确认密码:<input type="password" name="password2" maxlength="30" size="30"></br></br><input type="submit" value="提交"></form></body></html>
register.php
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Register</title></head><body><?php$username = $_POST['username'];$password1 = $_POST['password1'];$password2 = $_POST['password2'];if(!$password1 || !$username){echo "用户名或密码不能为空,请重新输入!";exit;}if($password1 != $password2){echo "两次密码不一致,请重新输入!";exit;}@ $db = new mysqli('localhost','root','cookie','cookie');if(mysqli_connect_errno()){echo "数据库链接失败,请重试!";exit;}$query = "insert into userinfo values(0,'".$username."','".$password1."')";$result = $db->query($query);if($result){echo "注册成功!<br />";}else{echo "注册失败!";}$db->close();?><a href="login.html">点击登录</a></body></html>
0 0
- register
- register
- register
- Register
- register
- register
- Register~~
- register
- register
- register
- register
- register
- register
- register
- register
- register
- register
- 寄存器(Register)
- 黑马程序员——Java之Thread类
- iOS应用间共享数据
- SqlServer调用CLR服务
- 操作系统学习--线程
- eclipse启动时报错org.eclipse.core.runtime.AssertionFailedException: assertion failed: The application ...
- register
- [LeetCode 8] String to Integer(atoi)
- Redis学习总结(JAVA篇)
- thinkphp消除URL中index.php的方法
- 优化数据页面(29)——打印连续页码
- Linux httpd 配置端口 apache httpd 域名配置
- 矩阵元素查找
- Java流程控制
- 启动hive命令报错 “Metastore contains multiple versions”