Reply to Re: Can GD load an image from another php script?

Your name:

Reply:


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]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация