Otóż chciałbym aby nie szedl insert gdy uploadowane zdjecie bedzie mialo inne rozszerzenie niż dopuszczalne.
Nie mam jednak pojecia jak to zrobic, kombinowałem już kilka razy i nic ;/
{ $obrazek = ''; { if ($sp1[1] == "gif" or $sp1[1] == "jpg" or $sp1[1] == "JPG" or $sp1[1] == "GIF" or $sp1[1] == "jpeg" or $sp1[1] == "JPEG" or $sp1[1] == "png" or $sp1[1] == "PNG") { $uploaddir = '../images/' . $data_img . '-'; $_FILES['obrazek']['name'] = przyjazny_string($_FILES['obrazek']['name']); { $obrazek = 'images/' . $data_img . '-' . $_FILES['obrazek']['name']; } } } $kategoria = $_POST['kategoria']; $wojewodztwo = $_POST['wojewodztwo']; $region = $_POST['region']; $kod = $_POST['kod_pocztowy']; $miasto = $_POST['miasto']; $adres = $_POST['adres']; $tel = $_POST['telefon']; $www = $_POST['www']; $email = $_POST['email']; function ValidEmail($email) { return false; } return true; } } } elseif (!ValidEmail($email)) { } elseif (!$sp1[1] == "gif" or $sp1[1] == "jpg" or $sp1[1] == "JPG" or $sp1[1] == "GIF" or $sp1[1] == "jpeg" or $sp1[1] == "JPEG" or $sp1[1] == "png" or $sp1[1] == "PNG") { } else { $iduser = $user_data['user_id']; $query = "INSERT INTO `ogloszenia` (`tytul`, `tresc`, `id_cat`, `id_woj`, `id_region`, `id_user`, `kod_pocztowy`, `miasto`, `adres`, `tel`, `www`, `email`, `zdjecie_1`) VALUES ('$tytul', '$tresc', '$kategoria', '$wojewodztwo', '$region', '$iduser', '$kod', '$miasto', '$adres', '$tel', '$www', '$email', '$obrazek')"; foreach ($_POST['opcje'] as $opcja) { } } return 1; } }