NameSilo

PHP - Header help

Spacemail by SpaceshipSpacemail by Spaceship
Watch

Souleclipse

Established Member
Impact
0
Currently this is my header:
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1;" />
<title>Zenstock</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link rel="shortcut icon" href="images/icon.jpg" />
<link rel="stylesheet" href="style.css" type="text/css" media="screen" charset="utf-8" />


It pretty common but i would like a line of code
<?php
header ("Content-type: image/png"); ?>


How do i add in?
I try by changing the content="image/png" but it does not work!
Any help will be appeciated.
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Your first code snippet is of standard HTML headers. Stuff that goes between <header></header> tags.

Your second code snippet is PHP code which sets an HTTP header telling the browser that they are about to receive a PNG image.

I'm not sure what you're asking. Could you explain what you're trying to accomplish?
 
0
•••
That PHP snippet will tell the browser you're sending it a PNG image. That shouldn't ever be in the same file as HTML, especially HTML <head> tag stuff.
 
0
•••
What are you trying to accomplish.
Do you just need to add an image to your existing html page?
If so you can link it thru a simple html tag as below:
<img src="myimage.png" />
 
0
•••
Image should be different PHP file.

This can be included into standard HTML page with <img src=image.php">

When this IMG is loaded it will call your image.php

Where you will need to supply that

<?php
header ("Content-type: image/png");
?>

Thanks.
 
0
•••
Ops, pardon me if i have not made my self clear.
I try to add the
<?php
header ("Content-type: image/png");
?>
in one of my web page but it does not produce the graph (I am using GD library resourses)|
It display that header it already define, and it does not show the graph,
where if i put the above code in somewhere else(without the header), it display the graph.
SO now i just want to make my webpage can include text and the graph, and not seperate.
 
0
•••
ok, actually you can't sent header information thru PHP after some text is rendered to the browser (even a single space will show the error "Header already defined").

Since you want to include both text & image in a single web page, I guess this would be the best bet.

You can store the image created through the GD library to some folder in your web server.
And then just link to that image thru html tag.
[Reason: If you send header with Content-Type:image/png it will not show up the textual part]
 
0
•••
oh, that sad!
anyway thanks. =D
 
0
•••
Dynadot — .com Registration $8.99Dynadot — .com Registration $8.99
Appraise.net

We're social

Unstoppable Domains
Domain Recover
NameMaxi - Your Domain Has Buyers
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back