Question about the output of the verification code Image in wordpress

Source: Internet
Author: User
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?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.