国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

こんにちは、先生。あなたのコースに従ってコードを書きました。フロントエンド データをデータベースに送信できず、ポップアップ プロンプトもありません。訂正してください。
Andy
Andy 2021-04-06 00:07:33
0
1
1207

//regiser

<!-頭部->{include file="public:header"/}<!-導(dǎo)航->{include file="public:nav"/ }

<div class="ページヘッダーテキストセンター"> <h2>用戶注冊(cè)</h2> </div> <form class="form-horizo??ntal" method='post' id="login"> <div class="フォームグループ"> <label for="inputEmail1" class="col-sm-2 control-label">用戶:</label> <div class="col-sm-10"> <input type="text" name="name" class="form-control" id="inputEmail1" placeholder="ユーザー名"> </div> </div> <div class="フォームグループ"> <label for="inputEmail2" class="col-sm-2 control-label">郵箱:</label> <div class="col-sm-10"> <input type="text" name="email" class="form-control" id="inputEmail2" placeholder="Email"> </div> </div> <div class="フォームグループ"> <label for="inputEmail3" class="col-sm-2 control-label">手機(jī):</label> <div class="col-sm-10"> <input type="text" name="mobile" class="form-control" id="inputEmail3" placeholder="Mobile"> </div> </div> <div class="フォームグループ"> <label for="inputEmail4" class="col-sm-2 control-label">秘密コード:</label> <div class="col-sm-10"> <input type="password" name="password" class="form-control" id="inputEmail4" placeholder="パスワード"> </div> </div> <div class="フォームグループ"> <label for="inputEmail5" class="col-sm-2 control-label">確認(rèn)密碼:</label> <div class="col-sm-10"> <input type="password" name="password_confirm" class="form-control" id="inputEmail5" placeholder="Password_confirm"> </div> </div> <div class="フォームグループ"> <div class="col-sm-offset-2col-sm-10"> <button type="submit" class="btn btn-default" id="register">注冊(cè)</button> </div> </div> </form></div>;<スクリプト> $(function () { $("#register").on('click',function () { alert($('#login').serialize()); $.ajax({ type:'post', url: "{:url( 'index/user/insert')}"、data:$( '#login')。serialize()、dataType: 'json'、success:function(data){alert( '成功成功') } }) }) })</script>{include file="public:rigt"/}{include file="public:footer"/}

// User

<?php/*** 登録ページ*/namespace app\index\controller;app\common\controller\Base を使用;app\common\model\User を UserModel として使用;think\facade を使用\Request;class User extends Base{ public function register() { $this ->assign('title','用戶注冊(cè)'); return $this ->fetch(); } public function insert() { if ( Request ::isAjax()){ $data = Request::Except('password_confirm','post'); if(UserModel::create($data)) { return ['status'=> 1, 'メッセージ'=> '注冊(cè)成功']; }else{ return ['ステータス'=> 0, 'メッセージ'=> '注冊(cè)失敗']; } }else{ $this -> error("請(qǐng)求類型錯(cuò)誤",'register'); } }}

Andy
Andy

全員に返信(1)
歐陽(yáng)

コードが亂雑すぎるため、ダウンロードした TP バージョンがありません。プロジェクト全體をパッケージ化して私に送ってください。

thinkphp の現(xiàn)在のバージョンはすでに 6 です。バージョン6を?qū)W習(xí)できます。

あなたの質(zhì)問(wèn)によると、PHP 操作が完了せずにエラーが報(bào)告された場(chǎng)合、JS コードにはポップアップ ボックスは表示されません。

最初に php コードをチェックして、エラーがないかどうかを確認(rèn)してください。ブラウザのF12で閲覧可能です。

最新のダウンロード
詳細(xì)>
ウェブエフェクト
公式サイト
サイト素材
フロントエンドテンプレート