In wordpress, the question about the output of the verification code image is that the "page" with id 209 is in page. php under the topic folder & lt ;? Php & nbsp; if (is_page ('000000') {& n question about the image of the verification code output in wordpress
The output is the "page" with id 209"
In page. php under the topic folder
If (is_page ('20140901 ')){
Header ("Content-type: image/gif ");
Header ("Cache-Control: no-cache ");
$ Rands = rand );
$ Im = imagecreate (40, 15 );
// Var_dump ($ im); exit ();
Imagecolorallocate ($ im, 240,240,240 );
$ Loc = 2;
$ Color1 = imagecolorallocate ($ im, 0, 0, 0 );
For ($ I = 0; $ I <4; $ I ++ ){
$ Color = imagecolorallocate ($ im, rand (0,255), rand (0,255), rand (0,255 ));
Imagestring ($ im, 4, ($ loc + 1), 1, substr ($ rands, $ I, 1), $ color1 );
Imagestring ($ im, 4, $ loc, 0, substr ($ rands, $ I, 1), $ color );
$ Loc + = 9;
}
Imagegif ($ im );
Imagedestroy ($ im );
Exit ();
} // Verification code
?>
This section of code is output normally under a separate file, and cannot be output normally here. Is the header output in the process before wordpress?
All error output in php. ini is enabled .. No prompt is displayed, indicating that an image fails to be displayed. php wordpress
------ Solution --------------------
How did you call page. php?
Is the img label used?