$image_max_width){ $resize=true; $srcHeight=$image_max_width*$srcHeight/$srcWidth; $srcWidth=$image_max_width; } if($image_max_height!=0 && $srcHeight >$image_max_height){ $resize=true; $srcWidth =$image_max_height*$srcWidth/$srcHeight; $srcHeight =$image_max_height; } if($resize) create_img_gd($targetFile, $targetFile, $srcWidth, $srcHeight); } } if($memory_error){ //error unlink($targetFile); header('HTTP/1.1 406 Not enought Memory',true,406); exit(); } } }else{ header('HTTP/1.1 406 file not permitted',true,406); exit(); } }else{ header('HTTP/1.1 405 Bad Request', true, 405); exit(); } if(isset($_POST['submit'])){ $query = http_build_query(array( 'type' => $_POST['type'], 'lang' => $_POST['lang'], 'popup' => $_POST['popup'], 'field_id' => $_POST['field_id'], 'fldr' => $_POST['fldr'], )); header("location: dialog.php?" . $query); } ?>