passing a url to a page

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have a display_image.php page

<?php



$image = imagecreatefromjpeg($img_url);
if ($image === false) { exit; }

// Get original width and height
echo $width = imagesx($image);
echo $height = imagesy($image);

// New width and height
$new_width = 200;
$new_height = 150;

// Resample
$image_resized = imagecreatetruecolor($new_width, $new_height);
imagecopyresampled($image_resized, $image, 0, 0, 0, 0, $new_width, 
$new_height, $width, $height);

// Display resized image
;
header('Content-type: image/jpeg');
imagejpeg($image_resized);
exit();

?>


I want to output this as an image but cannot get it working. I need to pass 
the image url something like this I thought would work

echo "<img src=\"display_image.php?img_url=$image_url>";


any ideas?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux