A problem occurs when new users use the TP framework to instantiate the Model. 1. A newbie wants to use the TP framework to write a login function. this is the login method in the controller. after the verification code is entered successfully, it enters else, instantiate the Model, and want to query the database.
2. this is the method in the Model. I want to output the content of the query database.
3. Why does one press login when I return to the login interface for debugging? this will prompt me to download the file, and I have not output the query database content? If I don't instantiate the Model, simply echo something in else to echo it.
Reply to discussion (solution)
What is the header output?
What is the header output?
What do you mean. Do you need this?
What is the header output?
I just tried to change it to else {
Echo $ _ POST ['username'];
Echo $ _ POST ['password'];
// $ Login = new \ Home \ Model \ LoginModel ();
// $ Login-> CheckLogin ($ _ POST ['username'], $ _ POST ['password']);
This time, $ _ POST is output directly. Why is output like this?
It should be because the extension of a file is incorrect, and the browser cannot read or parse the file. you can find the login file.
What is the header output?
I commented out the header ("content-type: text/html, charset = utf = 8") in Index. php today ");
Then you can. But I don't know why.
It should be because the extension of a file is incorrect, and the browser cannot read or parse the file. you can find the login file.
I commented out the header ("content-type: text/html, charset = utf = 8") in Index. php today ");
Then you can. But I don't know why.
For breakpoint debugging, you can see where the code is faulty and you cannot see the problem through your code at the moment.
It should be because the extension of a file is incorrect, and the browser cannot read or parse the file. you can find the login file.
I commented out the header ("content-type: text/html, charset = utf = 8") in Index. php today ");
Then you can. But I don't know why.
It's charset = utf8. in your writing, the hyphen equals. you press the-sign into the = sign .....