Y-STU-K
02-05-2003, 11:42 PM
Ok i'm trying to upload an image, save it and save a thumbnail image too. Now heres the first bit i've done which will just save it as a thumbnail but its not working :S can anyone suggest what i've done wrong ?
<?php
if (isset($_POST["Submit"]))
{
$path = "/images";
$size_w = 100;
$size_h = 75;
header("Content-type: image/jpeg");
$src_img = ImageCreateFromJpeg($_FILES["upload"]);
$dst_img = ImageCreate($size_w, $size_h);
imagecopyresized($dst_img, $src_img, 0, 0, 0, 0, $size_w, $size_h, ImageSX($src_img),ImageSY($src_img));
Imagejpeg($dst_img, $path, 100);
}
else
{
?>
<form name="form1" enctype="multipart/form-data" method="post" action="<?PHP $PHP_SELF; ?>">
<input name="upload" type="file" id="upload">
<input type="submit" name="Submit" value="Submit">
</form>
<?php
}
?>
oh one more thing. I'm currently having to develop this on my hosts web server as i can't get GD working in PHP on my localhost any ideas on that too ?
Thanx
Stu :)
<?php
if (isset($_POST["Submit"]))
{
$path = "/images";
$size_w = 100;
$size_h = 75;
header("Content-type: image/jpeg");
$src_img = ImageCreateFromJpeg($_FILES["upload"]);
$dst_img = ImageCreate($size_w, $size_h);
imagecopyresized($dst_img, $src_img, 0, 0, 0, 0, $size_w, $size_h, ImageSX($src_img),ImageSY($src_img));
Imagejpeg($dst_img, $path, 100);
}
else
{
?>
<form name="form1" enctype="multipart/form-data" method="post" action="<?PHP $PHP_SELF; ?>">
<input name="upload" type="file" id="upload">
<input type="submit" name="Submit" value="Submit">
</form>
<?php
}
?>
oh one more thing. I'm currently having to develop this on my hosts web server as i can't get GD working in PHP on my localhost any ideas on that too ?
Thanx
Stu :)