Posted by Lόpher Cypher on 01/03/06 22:37
Darkbyte [Work] wrote:
> Hi everybody!!!
> I have a script (foo.php) which uses GD to create an image and sends it
> to the browser:
>
> <?php
> $img = imagecreatefrompng("mypng.png");
>
> /* other stuff */
>
> header("Content-type: image/png");
> imagepng($img);
>
> imagedestroy($img);
> ?>
>
> I also have another php script: goofy.php.
> How can I use imagecreatefrompng to load the result of foo.php (without
> saving it on the hard disk first)?
>
> I tried with: imagecreatefrompng("foo.php") but doesn't work...
> Can anyone help me, please?
>
Try this:
$img = imagecreatefromstring(file_get_contents("http://.../foo.php"));
However, *do* use http:// in the name so that the function loads the
page and not the text file.
--
- lΓΌpher
---------------------------------------------
"Man sieht nur das, was man weiΓ" (Goethe)
[Back to original message]
|