Analysis on the solution to the problem that the verification code is not displayed in thinkphp, onethink and thinkox, thinkphpthinkox_PHP tutorial

WBOY
Release: 2016-07-12 08:50:12
Original
1077 people have browsed it

Analysis of solutions to the problem that the verification code is not displayed in thinkphp, onethink and thinkox, thinkphpthinkox

This article explains the solution to the problem that the verification code is not displayed in thinkphp, onethink and thinkox. Share it with everyone for your reference, the details are as follows:

When using the verification code, it worked fine at first, but then it stopped showing up

On the Internet, it is said that it is a UTF-8 encoding problem. What BOM should be removed and converted into a BOM-free format?

I tried everything, but it didn’t work

Later I found out that I wrote

where the verification code is called.
Public function verify(){
import('ORG.Util.Image');
Image::buildImageVerify();
}

Copy after login

Just change it to this:

Public function verify(){
import('ORG.Util.Image');
ob_clean();//这个就是关键
Image::buildImageVerify();
}

Copy after login

The purpose of the ob_clean function is to discard the content in the output buffer. If your website has many generated image files, you need to clear the buffer frequently if you want to access them correctly.

Readers who are interested in more thinkPHP-related content can check out the special topics on this site: "Introduction to ThinkPHP Tutorial", "Summary of Common Methods of ThinkPHP", "Summary of Cookie Usage in PHP", "Basic Tutorial for Getting Started with Smarty Templates" and "PHP Template technology summary".

I hope this article will be helpful to everyone’s PHP programming based on the ThinkPHP framework.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1133848.htmlTechArticleAnalysis of solutions to the problem that the verification code does not display in thinkphp, onethink and thinkox, thinkphpthinkox This article describes the examples of thinkphp, onethink and Solution to the problem that the verification code is not displayed in thinkox. Share to...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template