rendered paste body<form method="post" enctype="multipart/form-data" action="" >
<input type="file" name="dosya" />
<input type="submit" name="submit" />
</form>
<?
if(isset($_POST["submit"])) {
$percent=2;
list($width, $height) = getimagesize($_FILES[dosya][tmp_name]);
$newwidth = $width * $percent;
$newheight = $height * $percent;
// Load
$thumb = imagecreatetruecolor($newwidth, $newheight);
$source = imagecreatefromjpeg($_FILES[dosya][tmp_name]);
// Resize
imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
// Output
imagejpeg($thumb, 'images/ufak_resim.jpg', 100);
}
?>