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

???? ??? ??? ????
梁恒祥
梁恒祥 2018-06-03 09:58:11
0
4
1897

?LANG ] E:phpStudyPHPTutorialWWWhycythinkphplangzh-cn.php

[ ROUTE ] ?? ( )

[ HEADER ] ?? ( '??' => 'thinkphp_show_page_trace=1|2', 'accept-??' => 'zh- CN,zh;q=0.8', 'accept-encoding' => 'gzip, deflate', 'referer' => 'http://a.com/index.php/index/user/login', ' ??' => 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8', 'content-type' => www-form-urlencoded', 'user-agent' => 'Mozilla/5.0(Windows NT 6.1) AppleWebKit/537.36(KHTML, like Gecko) Chrome/56.0.2924.90 Safari/537.36 2345Explorer/9.3.2.17331', '????? -insecure-requests' => '1', 'origin' => 'http://a.com', 'cache-control' => 'max-age=0', 'content-length' = > '23', '??' => '??', '???' => 'a.com', )

[ PARAM ] ?? ( '??' => 'jh', '????' = > '123456', )

[ ?? ] E:phpStudyPHPTutorialWWWhycyapplicationindexviewuserlogin.html [ ?? ( 0 => '??', ) ]

if(??::isAjax()){

//數(shù)據(jù)驗(yàn)證

$data = ??::post();//獲取ajax提交數(shù)據(jù)

$rule = ['name|姓name'=> 'require|??:2,20|chsAlphaNum',

'password|密碼'=>'require|alphaNum',];

$res=$this->validate($data,$rule) ;

if (true !== $res){ ?//驗(yàn)證失敗

? return ['status'=> -1, 'message'=>$res];

? }else { //驗(yàn)證成功

? //2. 查詢數(shù)據(jù)表zh_user中,并對(duì)結(jié)果進(jìn)行判斷

? $result = Syuser::get(function($query) use ($data){

? $query->where('name',$data['name '])

? ?->where('password',sha1($data['password']));

? });

? // ??($result); //測(cè)試查詢結(jié)果

? if(null == $result){

? return ['status'=>0, 'message'=>'郵箱或密碼不正確,請(qǐng)檢查~~'];

} else{

//將用戶ID寫入session中

Session::set('user_id', $result->id);

Session::set('user_name', $result->name );

??::set('is_admin', $result->is_admin);

return ['status'=>1, 'message'=>'恭喜,登錄成功~~'];

}

} ?

}else{

$this->error('請(qǐng)求類型錯(cuò)誤','login');

}


梁恒祥
梁恒祥

?? ??(1)
小皮

???? ???? ??? ??? ????? AJAX ??? ??? ?? ????. ???? ??? ?? JS ??? ?????.

  • ???? <script type="text/javascript"> $(??(){ $('#submit').on('??',??(){ //Ajax? ???? ??? ?? ?? $.???({ ??: '???', url: "{:url('loginCheck')}", ???: $('#login').serialize(), ??? ??: 'json', ??: ??(???){ ??(???); ???(data.status) { ?? 1: //???? ???? ????? ?????. ??(???.???); window.location.href = "{:url('index/index')}"; ????; ?? 0: //?? ?? ??? ???? ??? ???? ?????. ??-1: ??(???.???); window.location.back(); ????; } } }) }) })
    梁恒祥 ?? 2018-06-07 15:30:22
  • ???? MySQL-Font? ??? ??? ???? ?? ???? ?????. ? ?? ??? ???? ?? id ??? Id? ??? ??? Modeluser?? id ??? ?? ? ????.
    李桃子 ?? 2018-11-07 22:11:51
  • ???? ?? ?????? ?? ????? ??? ?? ??? ?????.
    新新新新生 ?? 2019-01-02 15:31:55