Page 1 of 1
can't get my headers and footers working with my image :(
Posted: Mon Apr 19, 2004 5:33 pm
by mike08
any ideas
i have this code at the bottom of my show_poll.php page
PHP:
--------------------------------------------------------------------------------
<?
ob_start();
Header('Content-type: image/png');
ImagePng($im);
ImageDestroy($im);
include ('../includes/header.html');
include ('../includes/footer.html');
ob_end_flush();
?>
--------------------------------------------------------------------------------
but only can see the graph for making my online poll and can't see any of the header or footer files, wondered if someone could help
Posted: Mon Apr 19, 2004 5:35 pm
by Steveo31
Maybe taking them out of the ob_ functions...?
Posted: Mon Apr 19, 2004 5:39 pm
by tim
mike - I will hit you before the admins/mods do cause i'm sure my version will be more nice.
Do not flood the boards with the same question. Find one category n post one question!
read the rules/abide by them if you wish to get help, sheesh!
Posted: Mon Apr 19, 2004 5:45 pm
by PrObLeM
NO reason to multi post....
Posted: Mon Apr 19, 2004 5:56 pm
by mike08
apologies.
haven't read the rules

Posted: Mon Apr 19, 2004 6:04 pm
by PrObLeM
I don’t want to sound mean or anything but....
You have 42 posts... come on
ok regardless if you haven’t read the rules or not, its common curtsies not to do that.
just next time think before you post something like that
Now you know and knowing is half the battle...
Posted: Mon Apr 19, 2004 7:40 pm
by jason
Try:
Code: Select all
<?
ob_start();
Header('Content-type: image/png');
ImagePng($im);
ImageDestroy($im);
ob_end_flush();
?>
The problem is you were trying to mix .html stuff with the image. That's not what you want. If you want to include an image in an HTML file, you use an img tag like this
Code: Select all
<img src="path/to/imagescript.php" />
Posted: Mon Apr 19, 2004 10:40 pm
by JAM
JAM from other thread wrote:Code: Select all
<?php
// image.php is holding the header() and other info of the above picture
include ('../includes/header.html');
?>
<img src="image.php">
<?php
include ('../includes/footer.html');
?>
Dont bother Jason, this user cannot test something that is allready bounced as idea to him.
cheers!
Posted: Tue Apr 20, 2004 2:30 am
by mike08
Thanks ever so much Jam and jason - your magicians. Ive been struggling with that for days. - works like a gem now though.
sorry im not very good at this programming lark.
