ThinkPHP small POST is invalid. how can this problem be solved?-php Tutorial

Source: Internet
Author: User
ThinkPHP POST is invalid This POST was last edited by bluicez.pdf in 2013-03-1822: 38: 39 according to The POST value to display the page, but it seems that the POST value cannot be obtained: $ username & nbsp; $ this-& gt; $ _ POST [username]; $ name & nbsp; $ this-& gt ThinkPHP POST is invalid

This post was last edited by bluicez.pdf at 22:38:39

The page is displayed based on the value of POST, but the value of POST cannot be obtained:

$ Username = $ this-> $ _ POST ['username'];
// $ Name = $ this-> _ post ('name'); this industry is invalid.
$ User = M ('user ');
$ Data = $ user-> where ('username = "'. $ username.'" ')-> field ('Id, username')-> find ();
If ($ data ){
$ This-> success ('success ');
} Else {
$ This-> error ('failed ');
}


But the _ param method is successful. Please explain it.

Thinkphp? Post php


------ Solution --------------------
Isn't your post parameter username?

$ This-> _ post ('name'); of course it is invalid, $ this-> _ post ('Username'); try again
------ Solution --------------------
Dump ($ _ POST); give it a try

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.