-1

Can you help me in this regard. I am loading the image form, but I do not know how to resize it. The codes are as followings.

$gelenisimadi    = $_FILES["resim"]["name"];
$gelenisimturu   = $_FILES["resim"]["type"];
$gelenisimdizini = $_FILES["resim"]["tmp_name"];

$resimuzantisinibul = @substr($gelenisimadi,-4);
$resmiisimlendir    = @substr(md5(@uniqid(rand())),0,20);
$yeniresimadi       = $resmiisimlendir.$resimuzantisinibul;
$resimyukle         = @move_uploaded_file($gelenisimdizini,$dosyayolu.$yeniresimadi);

if($resimyukle){
  $sitekle = @mysql_query("INSERT INTO site (foto) VALUES ('$yeniresimadi')");
}
Nisse Engström
  • 4,555
  • 22
  • 24
  • 38
  • possible duplicate of [Resize image PHP?](http://stackoverflow.com/questions/9650572/resize-image-php) – Augwa Jan 15 '15 at 12:29
  • ...and http://stackoverflow.com/questions/14649645/resize-image-in-php – cari Jan 15 '15 at 12:30

2 Answers2

0

You can use PHP GD library which has image function and You can easily resize the image.

Click here! To read in detail

Dalvik
  • 4,119
  • 5
  • 28
  • 83
0
  1. please use the search function! resize image in PHP

  2. found in php manual: http://php.net/manual/de/function.imagecopyresampled.php

  3. further i allow my self a comment: the @-character before a function blocks all warning/error output. to end up with proper code, you should do a proper errorhandling instead of this. I don't see the reason for @substr(.... PHP: @ character before a function call
endo.anaconda
  • 2,299
  • 4
  • 25
  • 50