Re: Re: outputing image part 2
| From: | Richard Davey | Date: | Fri, 15 Jun 2007 21:08:35 +0000 |
| Subject: | Re: Re: outputing image part 2 | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-257132@lists.php.net to get a copy of this message | ||
Hi Ross,
Friday, June 15, 2007, 10:00:53 PM, you wrote:
> I have this
>
> $img_url="http://www.xxxxxxx.co.uk/images/ENbb24469/room1.JPG";
> echo "<img src=\"common/display_image.php?img_url='$img_url'\"
> width=\"200\"
height=\"100\" />>";
> and on the display image page I have:
> $img_url= $_GET['img_url'];
> $image = imagecreatefromjpeg($img_url);
> if ($image === false) { exit; }
> /// rest of the resize code goes here.....
> This still does not work but if I plug the url in manually at the top of
> display_image.php it works, this suggests it is not being sent properly.
You are sending a complete URL to your image, not a path. This means
that if your installation of PHP does NOT have the ability to open
files from URLs (allow_url_fopen) then it won't be able to open the
image from the location you gave it.
If you want to load in images from other web sites then make sure
allow_url_fopen is enabled in PHP. If you don't want to do this, then
don't pass in a URL, pass in the *path* to the image instead.
Cheers,
Rich
--
Zend Certified Engineer
http://www.corephp.co.uk
"Never trust a computer you can't throw out of a window"