Re: Creating Images using separate PHP files.
| From: | moshe doron | Date: | Tue, 17 Oct 2000 17:23:39 +0000 |
| Subject: | Re: Creating Images using separate PHP files. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-20670@lists.php.net to get a copy of this message | ||
keep the <? close to the starting of the page and the ?> that close it, the
last char on the page.
ur problem is ur file contain nlank chars that send before the header
--
moshe.
mosdoron@netvision.net.il
icq: 1542485
"Matt Glaves" <glaves@pinn.net> wrote in message
news:Pine.LNX.4.21.0010161547310.1418-100000@tigger.pinn.net...
>
> I have crated a class to generate a graph. If I include the class and the
> function calls in one file, it displays the image correctly. If I put the
> function calls in a separate file and call the class, a header error is
> displayed. I tried moving the header call to the file w/the functions,
> but it only displays a blank page.
>
> Things basically look like this:
> ------
> <?
> /*
> Header("Content-type: image/png");
> I tried adding this here but it generates header errors
> */
> require('graphclass.php');
> $graph = new GraphMe("Graph Title",500);
> $graph->addbar("one",1);
> $graph->addbar("two",2);
> $graph->addbar("three",3);
> $graph->addbar("four",4);
> $graph->drawgraph();
> ?>
> ------
> And here is basically what happens when the $graph->drawgraph function is
> called:
> ------
> Header("Content-type: image/png");
> $image = imagecreate($this->width(),$this->height());
> ImagePng($image);
> ImageDestroy($image);
> ------
>
> I assume that the first file needs to state that an image is coming and
> not a html file, but when I add the Header call to the first function it
> seems to think my class is printing to stdout.
>
> Any help would be wonderful!
>
> thanks,
>
> --
> Matt Glaves
> Systems Engineer
> Pinnacle Online
> www.pinn.net
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>