Thinkphp framework has some minor questions when I use thinkphp. for example, after verifying the user name, I want to pop up a window prompting that the logon fails, then display the template again, so I will write echo & nbsp; & lt; script & gt; alert (the new product has been imported into the database successfully) & lt; script & gt; $ this-& gt; display (XXX); however, this will cause some small questions about the thinkphp framework like css of XXX.
When I use thinkphp, for example, after verifying the user name, I want to pop up a window prompting logon failure, and then re-display the template
So I will write it like this
Echo "script" alert ('new product warehouse receiving successfully') script ";
$ This-> display ('XXX ');
However, this will cause XXX css style loading to fail. my friend said that there is no output before display.
How can we solve this problem?
What I know is that we can use $ this-> success ('OK'), but apart from the built-in success, is there any way to prevent the style sheet from being invalidated during display? Or is there any alternative?
------ Solution --------------------
If you do not need a built-in jump
1. you can split the login method from the login verification method. But there will be a method.
2. you can call ajax directly on the page to return error parameters and prompt errors.
For more information, see.
------ Solution --------------------
Same as above,
You can directly submit and determine the return value on the page ajax.
------ Solution --------------------
The template page uses ajax to submit to the php action, and displays the html (including style) controlled in js based on the return value of the action.
------ Solution --------------------
Thinkphp provides such dialog box code. you only need to call it.
You can use its automatic verification function, and do not need to focus on it.
If you prefer to write your own code, do not use thinkphp