Thinkphp framework 1

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

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.