What if the CAPTCHA is not displayed in thinkphp,onethink and thinkox
This article is about what to do if CAPTCHA is not displayed in thinkphp,onethink and thinkox. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
The details are as follows:
When using the CAPTCHA, it is normal at first, but it is not displayed later.
It is said on the Internet that it is the coding problem of utf-8. What kind of bom is removed and converted to a format without bom?
I tried. It didn't work.
Later I learned that it was written in the place where the CAPTCHA was called.
Public function verify () {import ('ORG.Util.Image'); Image::buildImageVerify ();}
Just change it to this:
Public function verify () {import ('ORG.Util.Image'); ob_clean (); / / this is the key Image::buildImageVerify ();}
The function ob_clean is used to discard the contents of the output buffer. If your site has many generated image files, you should always clear the buffer if you want to access it correctly.
Thank you for reading! This is the end of the article on "what to do if the CAPTCHA is not displayed in thinkphp,onethink and thinkox". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out for more people to see!