From edaa83437b767624da97b33fe4a219c205047222 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=90=BC?= <2910196733@qq.com> Date: Sun, 5 Jun 2022 17:09:41 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...13\347\275\221\344\275\234\344\270\232.md" | 172 ++++++++++++++++++ 1 file changed, 172 insertions(+) create mode 100644 "\346\226\271\347\220\274/20220605-php\347\211\265\346\211\213\347\275\221\344\275\234\344\270\232.md" diff --git "a/\346\226\271\347\220\274/20220605-php\347\211\265\346\211\213\347\275\221\344\275\234\344\270\232.md" "b/\346\226\271\347\220\274/20220605-php\347\211\265\346\211\213\347\275\221\344\275\234\344\270\232.md" new file mode 100644 index 0000000..eb544d1 --- /dev/null +++ "b/\346\226\271\347\220\274/20220605-php\347\211\265\346\211\213\347\275\221\344\275\234\344\270\232.md" @@ -0,0 +1,172 @@ +```mysql +create database qianshou charset utf8; +use qianshou; +create table user( + id int primary key auto_increment, + username varchar(10) not null, + password varchar(20) not null, + sex varchar(2) not null, + height double not null, + hobby varchar(30) not null, + age int not null, + address varchar(30), + phone int not null, + photo BLOB, + aboutme varchar(30) +) +``` + +```php +//conn.php + + + + + + + + + 用户登录 + + +
+

用户登录

+ + + + + +​ +​ +​ +​ +​ +​
请输入账号:
请输入密码:
+​ 注册
+
+ + +``` + +```html + + + + + + + 牵手网注册 + + +

用户注册

+
+ + + + + + + + + + + +​ +​ +​ +​ +​ +​ +​
用户名:
密码:
再次输入密码:
+ 性别: + 男 + 女 +
年龄:
身高:
+ 爱好: + 打羽毛球 + 唱歌 + 跳舞 + 游戏 + 旅游 + +​
手机号:
住址:
头像:
交友留言:
+
+ + + $value){ + if($key!='提交'){ + $$key=$value; + } +} +$hobby = implode(',',$hobby); + + + +include_once ('./conn.php'); + + +$sql = "insert into `user` value (null,'$username','$password1',$sex,'$height','$hobby','$age','$address','$phone',null,'$aboutme')"; + +$result = mysqli_query($conn,$sql); + +if($result){ + echo "注册成功。请登录!"; +}else{ + die("注册失败。".mysqli_error($conn)); +} + + + + + + + + + 用户登录 + + +
+

用户登录

+ + + + +​ +​ +​ +​ +​ +​
请输入账号:
请输入密码:
+​ 注册
+
+ + +``` + +```php +重新登录"); + } + echo "登录成功登入首页"; +``` + -- Gitee