Yangi formatda davom etish uchun: https://uzfor.net/view.php?act=post&id=49671
Postga havola
gi8ri7 [1900] [off]
JAMES_RODRIGUEZ, # JAMES_RODRIGUEZ (10.02.2019 / 18:19)
Saytga rasm yuklash kodini yozib yuboringlar ++
Saytga rasm yuklash kodini yozib yuboringlar ++
$upload_file_size = 300; require_once ('../incfiles/lib/class.upload.php'); $handle = new upload($_FILES['imagefile']); if ($handle->uploaded) { $handle->file_new_name_body = $name_file; $handle->file_max_size = 300 * $upload_file_size; $handle->file_overwrite = true; $handle->image_convert = 'png'; $handle->process('../files/images/'); if ($handle->processed) { $handle->file_new_name_body =$name_file . '_preview'; $handle->file_overwrite = true; $handle->image_resize = true; $handle->image_ratio_crop = true; $x_ratio = 80 / $GetImageSize[0]; $y_ratio = 80 / $GetImageSize[1]; if (($GetImageSize[0] <= 80) && ($GetImageSize[1] <= 80)) { $handle->image_x = $GetImageSize[0]; $handle->image_y = $GetImageSize[1]; } else if (($x_ratio * $GetImageSize[1]) < 80) { $handle->image_x = 80; } else { $handle->image_y = 80; } $handle->image_convert = 'png'; $handle->process('../files/images/'); if ($handle->processed) { echo '<div class="phdr"><b>Rasm yuklash</b></div>' . '<div class="gmenu">Rasm yuklandi!</div>' . '<div class="phdr"><a href="upload_img.php">Orqaga</a></div>'; }else echo functions::display_error($handle->error, '<a href="upload_img.php">Orqaga</a>'); } else echo functions::display_error($handle->error, '<a href="upload_img.php">Orqaga</a>'); $handle->clean(); } else { echo functions::display_error('Fayl tanlanmadi', '<a href="upload_img.php">Orqaga</a>'); } } else { echo '<div class="phdr"> <a href="faq.php?act=tags">ВВ-kodlar</a> | <b>Rasm yuklash</b></div>' . '<form enctype="multipart/form-data" method="post" action="upload_img.php?img"><div class="list1">' . 'Rasmni tanlang:<br /><input type="file" name="imagefile" value="" />' . '<input type="hidden" name="MAX_FILE_SIZE" value="' . (300 * $upload_file_size) . '" />' . '<br />' . '<p><input type="submit" name="submit" value="Yuklash" /></p></div></form>' . '<div class="list2"><small>Yuklash uchun ruxsat etilgan formatlar: JPG, JPEG, PNG, GIF<br />' . 'Rasm hajmi ' . $upload_file_size . 'kb dan oshmasligi lozim.</small></div>';