ThinkPHPajaxpost transmits parameters to the background, and the background cannot receive the parameters.

Source: Internet
Author: User
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?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.