ThinkPHPajaxpost transmits parameters to the background, and the background cannot receive $. ajax ({
Type: 'post ',
Url: '/index. php/Wechat/Shulte/gmtim ',
Data: {// submit parameters in this way
'Name': result
},
Success: function (msg ){
Alert (msg );
}
});
Ajax is successfully executed and packet capture is successful.
Public function gmtim (){
C ('show _ PAGE_TRACE ', false );
$ This-> info ();
$ Name = session ('name ');
Session ('Miao', $ _ POST ["name"]);
$ Time = session ('Miao ');
$ Where ['GM _ name'] = $ name;
$ Data ['GM _ gtime'] = $ time;
Var_dump ($ where );
Var_dump (session ('Miao '));
}
If no value is received in the background, a null value is returned.
Reply to discussion (solution)
Is your js code written in the template file?
Check whether the code is correct in the browser!
Is written in the foreground template, and other functions can be correctly executed. There is no problem with the url (/index. php/Wechat/Shulte/show), and the customer's account can also be obtained.
Is the problem solved by the landlord?