anonīms Posted March 9, 2008 Report Share Posted March 9, 2008 $reklaamas_bilde = augshupladejam_bildi('reklamas_bilde', SRV_ROOT . 'images/reklama/'); $sql = "UPDATE tbl_saturs SET sveiciens = '$sveiciens', par_mums = '$par_mums', kontakti = '$kontakti', email = '$email', reklama_bilde = '$reklaamas_bilde', reklama_teksts = '$reklama_teksts'"; unction augshupladejam_bildi($inputName, $uploadDir) { $reklaamas_bilde = $_FILES[$inputName]; // if a file is given if (trim($reklaamas_bilde['tmp_name']) != '') { $ext = substr(strrchr($reklaamas_bilde['name'], "."), 1); //$extensions[$image['type']]; // generate a random new file name to avoid name conflict $imagePath = md5(rand() * time()) . ".$ext"; list($width, $height, $type, $attr) = getimagesize($reklaamas_bilde['tmp_name']); // make sure the image width does not exceed the // maximum allowed width if (LIMIT_PRODUCT_WIDTH && $width > MAX_PRODUCT_IMAGE_WIDTH) { $result = createThumbnail($reklaamas_bilde['tmp_name'], $uploadDir . $imagePath, MAX_PRODUCT_IMAGE_WIDTH); $imagePath = $result; } else { $result = move_uploaded_file($reklaamas_bilde['tmp_name'], $uploadDir . $imagePath); } } return array('reklamas_bilde' => $imagePath); } Pati bilde kā tāda aplodojas un vārds viņai arī nomainas, bet kādēļ iekšs db, kur vajadzētu būt bildes nosaukumam rādas array? Errori nekādi nerādas. Link to comment Share on other sites More sharing options...
andrisp Posted March 9, 2008 Report Share Posted March 9, 2008 Tāpēc, ka tā funkcija atgriež masīvu nevis stringu. Link to comment Share on other sites More sharing options...
Recommended Posts