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

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

根據我的報告,我的表單未保存在數據庫中

根據我的報告,我的表單未保存在數據庫中

PHP
慕哥6287543 2022-01-08 16:52:53
我正在制作一個新的報告系統,我剛開始,設計已經完成,但是當我按下提交時,數據庫中沒有發生任何事情,我得到0條記錄。我的代碼有什么問題?或者我需要添加更多內容?我的觀點:<!-- Modal --><div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true" data-backdrop="static" data-keyboard="false">  <div class="modal-dialog" role="document">    <div class="modal-content" style="top: 50px">      <div class="modal-header" style="border-bottom: none">        <button type="button" class="close" data-dismiss="modal" aria-label="Close">          <span aria-hidden="true">&times;</span>        </button>      </div>      <div class="modal-body">        <div class="container">    <div class="row">        <section>        <div class="wizard col-md-6" style="right: 5px;margin: 0px auto">            <div class="wizard-inner">                <div class="connecting-line"></div>                <ul class="nav nav-tabs" role="tablist" style="margin: 0px auto">                    <li role="presentation" class="active">                        <a href="#step1" data-toggle="tab" aria-controls="step1" role="tab" title="Step 1">                            <span class="round-tab">                                <i class="icon-pencil"></i>                            </span>                        </a>                    </li>                    <li role="presentation" class="disabled">                        <a href="#step2" data-toggle="tab" aria-controls="step2" role="tab" title="Step 2">                            <span class="round-tab">                                <i class="icon-note"></i>                            </span>                        </a>
查看完整描述

2 回答

?
阿晨1998

TA貢獻2037條經驗 獲得超6個贊

在 Form 標簽內添加您的表單提交目的地和提交類型。目前表單標簽內沒有任何內容。并且不要忘記在表單中添加 csrf 字段。


例子:


<form role="form" action="{{ action('CareerSolutionController@careerReport') }}" method="post">

{!! csrf_field() !!}

或者


<form role="form" action="{{ url('career_report') }}" method="post">

{!! csrf_field() !!}


查看完整回答
反對 回復 2022-01-08
?
搖曳的薔薇

TA貢獻1793條經驗 獲得超6個贊

我看到了問題,您從未在刀片中定義表單操作,因此表單不知道該做什么。將您的表單打開更改為:

<form role="form" action="{{ action('CareerSolutionController@careerReport') }}>

并且不要忘記在其下方添加 crsf 令牌:

@csrf

或者為方便起見,為您的路線添加自定義名稱:

Route::post('career_report', 'CareerSolutionController@careerReport')->as('career.report');

并像這樣以您的形式使用它:

<form role="form" action="{{ route('career.report') }}" method=POST>


查看完整回答
反對 回復 2022-01-08
  • 2 回答
  • 0 關注
  • 157 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號

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