imagecopyresampled() проблем

Код:
if (move_uploaded_file($file_tmp,$upload_dir.$file_name)) {
list($width,$height)=getimagesize($upload_dir.$file_name);
$percent = 0.5;
$new_width = $width * $percent;
$new_height = $height * $percent;
$image_p = imagecreatetruecolor($new_width, $new_height);
$image = imagecreatefromjpeg($upload_dir.$file_name);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, 75, 95);
imagejpeg($image_p, null, 100);
echo "<center>Файла е качен успешно! <br><br>";
exit();
}

Това ми е кода, след като напиша header-а , ме праща в друга страница която пише само localhost/upload.php.. :(
 

Back
Горе