Php performs a verification code. the output image shows garbled characters. how can this problem be solved? Paste the source code:
Excuse me !!! This problem has been found many on the Internet, basically with these three errors:
1. a BOM header is available; I have removed it.
2. the GD Library has not been opened; I have already opened
3. no output exists before the header, and I have no output.
Why?
Reply to discussion (solution)I just tried it. after moving the file for obtaining images to a sub-folder of the project, it will be displayed. I put it directly under the root directory of the project, and the obtained images are garbled. I don't know why. I hope you can share the reason!
VerifyImage function not executed, or spelling error
String. func. php loading failed
BuildRandomString function name spelling error
The font file does not exist.
VerifyImage function not executed, or spelling error
String. func. php loading failed
BuildRandomString function name spelling error
The font file does not exist.
I just moved the file that calls the verifyImage () function from the root directory to the subdirectory. why? $ Fontfile = "../fonts/". $ fontfiles [mt_rand (0, count ($ fontfiles)-1)];
The file cannot be found because the location has changed.
Can't you store your font files everywhere?
$ Fontfile = "../fonts/". $ fontfiles [mt_rand (0, count ($ fontfiles)-1)];
The file cannot be found because the location has changed.
Can't you store your font files everywhere?
No, my font files are all placed in the fonts folder, and the path cannot be wrong. Please forgive me for the curse!
It has been several days since I closed my post!
$ Fontfile = "../fonts/". $ fontfiles [mt_rand (0, count ($ fontfiles)-1)];
The file cannot be found because the location has changed.
Can't you store your font files everywhere?
No, my font files are all placed in the fonts folder, and the path cannot be wrong.
Then you know $ fontfile = "../fonts/". $ fontfiles [mt_rand (0, count ($ fontfiles)-1)];
Is this actually a relative path?
$ Fontfile = "../fonts/". $ fontfiles [mt_rand (0, count ($ fontfiles)-1)];
The file cannot be found because the location has changed.
Can't you store your font files everywhere?
No, my font files are all placed in the fonts folder, and the path cannot be wrong.
Then you know $ fontfile = "../fonts/". $ fontfiles [mt_rand (0, count ($ fontfiles)-1)];
Is this actually a relative path?
En, you know. it was originally placed in the root directory and the obtained path is incorrect.
Thank You!