亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

多個登錄表單在 Laravel 中不起作用

多個登錄表單在 Laravel 中不起作用

PHP
精慕HU 2023-08-19 14:14:54
Laravel 6.PHP 7.4。我正在建立一個網站。由于 Laravel 提供了默認的身份驗證登錄和注冊表單。我將登錄表單放入導航中,而將注冊表單放在注冊頁面上。現在我想讓用戶在注冊頁面上提供另一個登錄表單。我設計了另一個登錄表單,在提交時我將其引用到相同的登錄路線,但它不起作用。錯誤是 419 頁已過期。我還閱讀了有關 MutiAuth 的內容,但這是我將用于我的管理面板的內容。有什么解決辦法嗎?注冊.blade<form method="post" action="{{ route('login') }}"  onsubmit="if(document.getElementById('agreed').checked) { return true; } else { alert('Please indicate that you have read and agree to the privacy policy and terms of use'); return false; }">                                              <div class="input-group form-group"> <div class="input-group-prepend">       <span class="input-group-text"><i class="fas fa-user"></i></span> </div> <input type="email" required name="email" class="form-control" placeholder="email address">  </div>    <div class="input-group form-group">       <div class="input-group-prepend">             <span class="input-group-text"><i class="fas fa-key"></i></span>   </div>        <input type="password" required name="password" class="form-control" placeholder="password">    </div>     <div class="form-group">        <input type="checkbox" name="checkbox" value="check" id="agreed" />            <small>I agree to the privacy policy and terms of use</small>      </div>             <div class="form-group">         <input type="submit" value="Login" class="btn float-right login_btn">      </div>    </form> 路線Route::get('login', [  'as' => 'login',  'uses' => 'Auth\LoginController@showLoginForm']);
查看完整描述

1 回答

?
飲歌長嘯

TA貢獻1951條經驗 獲得超3個贊

您需要@csrf在您的<form>.



查看完整回答
反對 回復 2023-08-19
  • 1 回答
  • 0 關注
  • 105 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號