注册与登录的页面设计

HTML代码

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>提交</title>
</head>
<style>
    .div1 {
        /*调整矩形框的大小、居中、颜色*/
        height: 30%;
        width: 40%;
        margin: auto;
        margin-top: 15%;
        color: #2ca02c;

        text-align: center;
        background-color: #76deff;
        /*让边框变成圆角*/
        -moz-border-radius: 10px;
        -webkit-border-radius: 10px;
        border-radius: 10px;
        /*给边框添加阴影样式*/
        box-shadow: 2px 4px 6px #000;

    }

    .div2 {
        height: 20%;
        border-bottom: 1px solid #1099c5;
        font-family: 微软雅黑;
        font-size: 20px;
        line-height: 40px;

    }

    .div3 {
        margin-top: 20px;

    }

    /*页面的背景颜色*/
    body {
        background-color: #c5e1ea;
    }

    /*“提交”按钮的样式*/
    .fill:hover,
    .fill:focus {

        box-shadow: inset 0 0 0 2em var(--hover);
    }

    .fill {

        --color: #a972cb;
        --hover: #cb72aa;
    }

    button {
        color: var(--color);
        -webkit-transition: 0.25s;
        transition: 0.25s;
    }

    button:hover, button:focus {
        border-color: var(--hover);
        color: #fff;
    }

    button {
        background: none;
        border: 2px solid;
        font: inherit;
        line-height: 1;
        margin: 0.5em;
        padding: 1em 2em;
    }

    .div33 {
        width: 30%;

    }
</style>
<body>
<div class="div1">
    <div class="div2">
        资料提交
    </div>
    <div class="div3">
        <form method="post" action="{:url('tijiao/post')}">
            账户:
            <input type="text" class="div33" name="account"><br>
            <br>
            密码:
            <input type="password" class="div33" name="password"><br><br><br>
            <button class="fill">提交</button>
    </div>

    </form>


</div>
</body>
</html>

PHP代码

<?php
namespace app\index\controller;
use think\Request;
use think\Controller;
class Tijiao extends Controller
{
    public function index()
    {
        return view();
    }

    public function post(){

        //前端提交上来的数据
        $data['account'] = Request::instance()->param('account');
        $data['password'] = Request::instance()->param('password');


        //存储提交上来的数据
        $res =  db('dengru')->insert($data);
        if($res){
            return "提交成功";
        }else{
            return "提交失败";
        }
        dump($data);



    }
}



  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值