<?php $opis = $_POST['opis']; $zdjecie = $_FILES['zdjecie']['name']; $ImageDir ="C:/Program Files/EasyPHP1-8/www/zdjecia/"; $ImageThumb = $ImageDir . "thumbs/"; $ImageName = $ImageDir . $zdjecie; if ($type > 3) { } else { $insert = "INSERT INTO realizacje (opis, zdjecie, data) VALUES ('$opis', '$zdjecie', '$today')"; $newfilename = $ImageDir .$lastpicid . ".jpg"; if ($type == 2){ } else { if ($type == 1) { $image_old = imagecreatefromgif($ImageName); } elseif ($type == 3) { $image_old = imagecreatefrompng($ImageName); } $image_jpg = imagecreatetruecolor($width, $height); imagecopyresampled($image_jpg, $image_old, 0, 0, 0, 0, $width, $height, $width, $height); imagejpeg($image_jpg, $newfilename); imagedestroy($image_old); imagedestroy($image_jpg); } $newthumbname = $ImageThumb . $lastpicid . ".jpg"; $thumb_width = $width * 0.10; $thumb_height = $height * 0.10; $largeimage = imagecreatefromjpeg($newfilename); $thumb =imagecreatetruecolor($thumb_width, $thumb_height); imagecopyresampled($thumb, $largeimage, 0, 0, 0, 0, $thumb_width, $thumb_height, $thumb_width, $thumb_height); imagejpeg($thumb, $newthumbname); imagedestroy($largeimage); imagedestroy($thumb); $url= "location: showimage.php?id=" . $lastpicid; } } ?>
Dlaczego?