Problem of output image with header and imagejpeg

Source: Internet
Author: User
Headers (' Content-type:image/jpeg ') and imagejpeg ($img) can output images, but there is no way to output other content at the same time, such as a paragraph,

If you use Imagejpeg ($img, ' path '), first save the image and then output to refresh the page.

What can be achieved: on the same page, with the form input parameters, using GD2 to make an image, and then output the image on this page, keep the content of HTML, do not refresh.


I novice, may problem level is lower, everybody haihan.


Reply to discussion (solution)

Imagejpeg ($img, ' path ');
Echo ';
Give it a try.

Package the image you need to output separately, the path can be http://www.example.com/action/method/

Add an image tag display to the HTML that you want to output at the same time.

......

Seems to only encapsulate, the second floor of the method to refresh to display the current page input data made of the chart.

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