模板表單資料提交於後臺的接受機制

發表於2019-05-11
前臺登陸表單:
<form class="login-form" method="post" action="/ot/index.php?s=/admin/public/login.html">
<h3 class="welcome"><i class="login-logo"></i>OneThink管理平臺</h3>
<div class="item-box" id="itemBox">
<div class="item"><i class="icon-login-user"></i>
<input type="text" autocomplete="off" placeholder="請填寫使用者名稱" name="username">
                            </div>
                            <span class="placeholder_copy placeholder_un">請填寫使用者名稱</span>
                            <div class="item b0">
                                <i class="icon-login-pwd"></i>
                                <input type="password" autocomplete="off" placeholder="請填寫密碼" name="password">
                            </div>
                            <span class="placeholder_copy placeholder_pwd">請填寫密碼</span>
                            <div class="item verifycode">
                                <i class="icon-login-verifycode"></i>
                                <input type="text" autocomplete="off" placeholder="請填寫驗證碼" name="verify">
                                <a href="javascript:void(0)" title="換一張" class="reloadverify">換一張?</a>
                            </div>
                            <span class="placeholder_copy placeholder_check">請填寫驗證碼</span>
                            <div>
                                <img src="/ot/index.php?s=/admin/public/verify.html" alt="點選切換" class="verifyimg reloadverify">
                            </div>
                        </div>
                        <div class="login_btn_panel">
                            <button type="submit" class="login-btn">
                                <span class="in"><i class="icon-loading"></i>登 錄 中 ...</span>
                                <span class="on">登 錄</span>
                            </button>
                            <div class="check-tips"></div>
                        </div>
                    </form>

後臺控制器
public function login($username = null, $password = null, $verify = null){
//示例:
        if(!check_verify($verify)){
             $this->error('驗證碼輸入錯誤!');
            }
    }
為什麼login方法裡面的引數可以接收到前臺相對應的值?
回覆

相關文章