z gory dziekuje i pzodrawiam
<?php $naz = $_POST['naz']; $price = $_POST['price']; $inventory = $_POST['inventory']; $rodzaj = $_POST['rodzaj']; $image_tempname = $_FILES['image_filename']['name']; // umieszczenie obrazu i sprawdzenie jego formatu $ImageDir ="images/"; //**WSTAW TEN WIERSZ $ImageThumb = $ImageDir . "thumbs/"; //**KONIEC WSTAWIENIA $ImageName = $ImageDir . $image_tempname; $ImageName)) { // pobranie informacji na temat umieszczonego obrazu if ($type3) { "PNG."; } else { // obraz jest w poprawnym formacie, można kontynuować // wstawienie informacji w tabeli images $insert = "INSERT INTO products (products_name, products_proddesc, products_price, products_inventory, products_rodzaj) VALUES ('$naz', '$opis', '$price', '$inventory', '$rodzaj')"; $newfilename = $ImageDir . $lastpicid . ".jpg"; if ($type == 2) { } else { if ($type == 1) { $image_old = imagecreatefromgif($ImageName); } elseif ($type == 3) { $image_old = imagecreatefromjpg($ImageName); } // skonwertuj obraz do formatu JPG $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); } //**WSTAW NASTĘPUJˇCE WIERSZE $newthumbname = $ImageThumb . $lastpicid . ".jpg"; // pobierz wymiary miniaturki $thumb_width = "180"; $thumb_height ="132"; // utwórz miniaturkę $largeimage = imagecreatefromjpeg($newfilename); $thumb = imagecreatetruecolor($thumb_width, $thumb_height); imagecopyresampled($thumb, $largeimage, 0, 0, 0, 0, $thumb_width, $thumb_height, $width, $height); imagejpeg($thumb, $newthumbname); imagedestroy($largeimage); imagedestroy($thumb); //**KONIEC WSTAWIANYCH WIERSZY ?>