Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3395006
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T04:14:17+00:00 2026-05-18T04:14:17+00:00

I started working on page for my school project today, and I find myself

  • 0

I started working on page for my school project today, and I find myself stucked. The HTML and PHP is quite simple, even if PHP I saw for first time, because it’s almost same as C. But the problem I got is about HTML meta tags and so on, specificaly the content-type. I want to generate image with php code which I already do with an ease, but when I want to display it that tag comes to game. I already came to conclusion that setting Content-Type tag with PHP is using last call to command like

header("Content-type:image/jpeg");

Now that I want to display my image, this tag has to be set as in the command, but then the whole page comes as image. On other hand with setting text/html, image displays as text. Is it possible to dynamicaly change that element in one file? I doubt, because only one head specification is possible at all, but I think there are guys much smarter then me with some work-arounds.

Everything I want to do now is generating image and displaying it where I want. I want to be able to parametrize that image also. I already created working solution with HTML tag <img src="img.php",x,y> ,where img.php is generating image, but it’s setting anyway Content-Type to image and it’s just whole way around, as how to get 2 head specifications. Also I can’t set any parameters for this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T04:14:18+00:00Added an answer on May 18, 2026 at 4:14 am

    You can only commit one Content-Type per response. You can respond with an image or you can respond with a page, but not both. They must be two separate HTTP requests.

    One way to solve this is to have your img.php script serve the image (as it sounds like it already is), and then a different script which serves your HTML. The HTML it serves will reference the img.php script, such as:

    <img src="img.php?x=4&y=5" alt="" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I started working on a project which uses Net_URL_Mapper from PEAR (php) as the
I started working with php and mysql today. Basically, what I have, is an
I just started working on a huge gwt project and asked myself if there
First off sorry if I'm missing something simple just started working with AJAX today.
I started working on a project in the mid. We are using Zend Framework,
I have a project that I have recently started working on seriously but had
I am new to Django and have started working on a mature Django project.
I'll try to make this as simple a posible. I just started working with
I have just started working on a struts2 project. I have seen the power
I'm working on a website project w/ a team. And they started the code,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.