Location: PHPKode > scripts > Simple Image Resizer > simple-image-resizer/test.php
<html>

<head>
<title>Image Resize</title>
</head>

<body>

<form enctype="multipart/form-data" method="POST" action="<?php echo $_SERVER['SELF'];?>">
	Photo: <input type=file name=photo size="20"><br>
	Proportional: <input type="radio" value="yes" checked name="R1"> <input type="radio" value="no" name="R1"><br>
	Width: <input type="text" name="width" size="20"><br>
	Height: <input type="text" name="height" size="20"><br>
	<input type="submit" name="submit" value="Resize">
</form>

<?php
	if ($_POST['submit'])
	{
		require_once("ImageResize.inc");
				
		if ($_POST['R1'] == "yes")
		{
			// proportional
			$r = new Resize($_FILES['photo']['tmp_name'], $_POST['width'], 0, true);
			// or $r = new Resize($_FILE['photo']['tmp_name'], 0, $_POST['height'], true);
		} else
		{
			// Force the image size
			$r = new Resize($_FILES[photo][tmp_name], $_POST[width], $_POST[height], false);			
		}		
		$r->ImageResize();
	}
?>

</body>

</html>
Return current item: Simple Image Resizer