PHP Drawing: "Image error, unable to display"

Source: Internet
Author: User
Tags set background
This PHP code is my local file 1.php, and then output the layer in Firefox, displaying "image error, unable to display." I thought it was the other day. Due to a cookie for other programming settings, I found the cookie was deleted, but the same error was displayed. Then I copied the code to the same directory. 2.php, you can display the layer on firebox. Ask the great God for advice, what is the reason.


  
   

Reply to content:

This PHP code is written on the local file 1.php , and then output the layer in Firefox, displaying "image error, unable to display." I thought it was the other day. Due to a cookie for other programming settings, I found the cookie was deleted, but the same error was displayed. Then I copied the code to 2.php in the same directory, and you can display the layer on firebox. Ask the great God for advice, what is the reason.

 !--? Phpheader ("Content-type:image/jpeg");//Create Layer $img= Imagecreate (100,100);//Set Background color $bg=imagecolorallocate ($img, 0,0,0);//Output Image imagejpeg ($img);//Close Resource Imagedestroy ($img) ;

With file naming okay, press F5 refresh try

1 comments written on the code is really a tortured goblin. The

2 header is clearly written. If I had enough prestige, I would go for that downward arrow.

3 involves the modification of the picture, generally with c-f5 forced to refresh.

FileName is also relevant! always feel wrong ...

Same as 2 floor, if I have enough prestige, I'm going to go to touch which ↓ arrow

  • 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.