Permintaan segera untuk permintaan ajax tp5 Data tidak boleh ditambah ke pangkalan data.
一米阳光
一米阳光 2019-01-06 00:14:39
0
2
1241

Soalan: Data belum ditambah ke pangkalan data, sila berikan jawapan kepada pihak pengurusan, terima kasih


<!--Header-->
{include file="public:header" / }
<! --Navigasi-->
{include file="public:nav" /}

<div class="row">
<!--Paging-->
< div class="col -md-8">
                                                                                                                                                                                                                                                                                                                                borang                                                    ;                                                                   ;                                                                          ;                                                                           ; form-control" id="inputEmail1" placeholder="UserName">
                                                                                                                           
                                                                                                                                                                                                                                                                                         name="email" class="form-control" id= "inputEmail2" placeholder="E-mel">
                                                                         ;
           <div class="form-group">
               <label for="inputEmail3" class="col-sm-2 control-label">手机号:< ;&   label kelas div ="col-sm-10">
                   <input type="text" name="mobile" class="form-control" id="inputEmail3" placeholder="Mudah alih">
          ;/div  < </div>
           <div class="form-group">
               <label for="inputPassword4" class="col-sm-2 control-label">密;   label   < ;div class="col-sm-10">
                   <input type="password" name="password" class="form-control" id="inputPassword4" placeholder="Password">
    ;        ;   div>码:</ label>
               <div class="col-sm-10">
                   <input type="password" name="password_confirm" class="form-control" id="gt"confirm placeholder" id="gt. ;
               </div>
           </div>
           <div class="form-group">        lt -2 col-sm-10">
                   < ;button type="submit" class="btn btn-primary" id="register">注册</button>
               </div>
           <;
       </form>

   </div>
   <skrip>
       $(function(){
       (' daftar "(')"          // makluman ( $('#login').serialize());
               $.ajax({
                   type:'post',
                                           url             data: $( '#login').serialize(),
                   dataType:'json',
                   success:function (data) {
                                                                                 
                   }
               })
           })
       })
   </skrip> ;

   {include file="public:right" /}
</div>
<!--Tail-->
{include file="public:footer" /}


<?php

namespace appindexcontroller;

gunakan appcommoncontrollerBase;
use appcommoncontrollerBase;
use appcommonmodelUserfader; ;
Pengguna kelas meluaskan Pangkalan
{
daftar fungsi awam()
{
$this->assign('title','User registration');
return $this->fetch();
}

Memproses Maklumat pendaftaran diserahkan oleh pengguna
public function insert()
{
//Gunakan model untuk mencipta data
//Dapatkan data yang diserahkan oleh pengguna melalui borang
if(Request::isAjax()){
$data = Permintaan:: Kecuali ('password_confirm', 'post'); ;
                                                                                                                                                                                                                                                                                                         pulangkan ['status'=>0,'message'=>'Pendaftaran gagal, sila semak']; $this->error("Request type error);}' }
}




Soalan: Data belum ditambah ke pangkalan data, sila uruskan jawapan, terima kasih

一米阳光
一米阳光

membalas semua(1)
秋香姐家的小书童

Buka konsol penyemak imbas untuk melihat apa yang AJAX pulangkan

Muat turun terkini
Lagi>
kesan web
Kod sumber laman web
Bahan laman web
Templat hujung hadapan