Home > Backend Development > PHP Problem > What should I do if the php verification code does not display characters?

What should I do if the php verification code does not display characters?

藏色散人
Release: 2023-03-12 10:40:01
Original
3123 people have browsed it

The solution to the problem that the php verification code does not display characters: 1. Open the gd library; 2. Directly request the URL of the image; 3. Change the file to utf-8 encoding without BOM; 4. Add ob_clean() Just function.

What should I do if the php verification code does not display characters?

The operating environment of this article: windows7 system, PHP7.1 version, DELL G3 computer

What should I do if the php verification code does not display characters? ?

The verification code in php does not display the problem

1. First, you must make sure that your gd is turned on and there is no problem with your server

 

2. When your verification code does not display, you can directly request the URL of your image

Syntax error:

Logical error:

At this time, , if a syntax error occurs, the page will have corresponding prompts.

 ButThere is no syntax error, only a black screen

 

 Step2Change header('Content -Type:image/jpeg')Comment and then you can find the error message again

 

Just solve !

3. The reason why the picture cannot be displayed: ExtraOutput

  

 BOMutf-8 signature of the encoded file, three bytes of hidden characters. is also output by ! You need to encode the file into utf-8 without BOM

4. If it doesn’t work at this time, then add an ob_clean(); to the header.

 

 The role of ob_clean()

 

That’s it now

Finally found the problem, I hope it can help everyone

Recommended study: "PHP Video Tutorial"

The above is the detailed content of What should I do if the php verification code does not display characters?. For more information, please follow other related articles on the PHP Chinese website!

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