{include file="public:nav"/}
//regiser
{include file="public:header"/}{include file="public:nav"/}
//User
assign('title','用户注册'); return $this ->fetch(); } public function insert() { if ( Request ::isAjax()){ $data = Request::except('password_confirm','post'); if(UserModel::create($data)) { return ['status'=> 1, 'message'=> '注册成功']; }else{ return ['status'=> 0, 'message'=> '注册失败']; } }else{ $this -> error("请求类型错误",'register'); } }}
Your code is too messy, and there is no TP version you downloaded. You can package the entire project and send it to me.
The current version of thinkphp is already 6. You can learn version 6.
According to your question, if the PHP operation is not completed and an error is reported, there will definitely be no pop-up box in the JS code.
Check the php code first to see if there are any errors. F12 of the browser can be viewed.