ThinkPHP POST does not display the page according to The POST value, but it does not seem to get the POST value: $ username & nbsp ;=& nbsp; $ this-& gt; $ _ POST ['username']; // $ name & nbsp; = & nbsp; $ this-& gt; _ post (ThinkPHP POST is invalid
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.
------ 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