Describe that your problem GD library has been opened. search for solutions from other friends: Clear BOM, ob_clean (), and do not display line breaks at the starting position of the Code. Paste the relevant code {code ...}
-
Describe that your problem GD library has been opened. search for solutions from other friends: Clear BOM, ob_clean (), and do not display line breaks at the starting position of the Code.
-
Paste related Code
Reply content:
-
Describe that your problem GD library has been opened. search for solutions from other friends: Clear BOM, ob_clean (), and do not display line breaks at the starting position of the Code.
-
Paste related Code
After testing, your code has the following problems:
When Random underline is implemented, the input parameter of imagecolorallocate is incorrect. Four params should be given, and the current Code gives six parameters.
Result: After modification, the verification code is displayed as normal.
Here, imagecolorallocate should contain four parameters.
I don't understand what you mean. What do you mean?
The result is
Check the error log and try again.
Header ('content-Type: image/png ');
Check the DOM header from all the files in the framework from other places.
Try copying some successful code on the Internet first. If it succeeds, it is your code problem. Otherwise it should be an environment problem.
Is GD not installed? Check phpinfo ()
Clear the output buffer before header,
ob_clean()header('Content-Type:image/png');imagepng($_img);
The final verification code is soy sauce,
So the question is,
1. Why?ob_clean()To addimagepng()Before?
Apparently,header()The previous Code will not be cachedObWhich of the following statements is actually cached to ob?imagepng()The generated verification code. When you refresh the code in the browser,ob_clean()Will clear the previousOb. Thenimagepng()Generate a verification code and save itOb,ObThen it is thrown into the program cache and packaged into the browser.
2. If noob_clean()A verification code will also be generated. Where does the verification code go?
Use php5.4 or earlier or disableOb.
Ps: After php5.3,ob_start()Enabled by default, repeated additionob_start()Will causeob_end_*()Invalid. (Oops .. if the code ob_start is repeatedly edited locally, an error occurs. However, an upload class can run properly. For more information, see .)
First, thank you for helping you modify the code highlight. It won't work if you change it several times. It's used for the first time. Try again.