[code]<?php
	
	if(isset($_POST["bevestiging"])){

		$naam = $_POST["naam"];
		
		$allow[0] = "pjpeg";
		$allow[1] = "gif";
		$allow[2] = "png";
		$allow[3] = "pjpg";
		$allow[4] = "jpg";
		$allow[5] = "jpeg";
		$allow[6] = "x-png";

		$locatie = "images/";
		
		global $_FILES;
		
		$f_extentie = $_FILES["file"]["type"];
		
		$extentie = explode("image/", $f_extentie);

		for($i = 0; $i < count($allow); $i++){ 
   			
			if(strtolower($extentie[1] == $allow[$i])){ 
       		
			$extentie_check = "ok"; 
       		$i = count($allow) + 5;
  	
			} 
		} 
		
		if(file_exists($locatie.$naam)){
		
			echo "Kies een andere naam voor het bestand<br><br>";
			
		}else{
		
			if($extentie_check){
		
				if(is_uploaded_file($file)){
				
					move_uploaded_file($file, $locatie.$naam);
							
					list($width, $height, $attr, $type) = getimagesize("images/$naam");
							
					$size = filesize("images/$naam");
						
					if($width > 120 or $height > 200){
							
						echo "Maximale grootte 120x200. Probeer het opnieuw.<br><br>";
								
						unlink("images/$naam");
								
					}elseif($size > 1000000){
							
						echo "Uw bestand gaat over het limiet van 1 mb heen. De grootte van uw bestand is $size.<br><br>";
						
						unlink("images/$naam$ext");
								
					}else{
							
						echo "Uw bestand is upgeload<br><br><img src='images/$naam'><br><br>URL: url/images/$naam";
								
					}
					
				}
				
			}else{ echo "Verkeerde extentie.<br><br>"; }
			
		}
		
		echo "<a href='javascript:history.back();'>Terug</a>";
					
	}else{	
		
?>
<table width="450">
	<tr>
		<td align="left" width="100%"><strong>Upload file:</strong><br><br>* Max file size: 1 MB<br>* Maximum size picture 120x200<br>* Extenties: jpg(jpeg), gif, png<br><br></td>
	</tr>
</table>
<table width="450">
	<form action="<?php $_SERVER['PHP_SELF'];?>" method="post" enctype="multipart/form-data">
	<input type="hidden" name="bevestiging" value="1">
	<tr>
		<td align="right" width="10%">File:</td>
		<td align="left" width="90%"><input type="file" name="file"></td>
	</tr>
	<tr>
		<td align="right" width="10%">Name:</td>
		<td align="left" width="90%"><input type="text" name="naam"></td>
	</tr>
	<tr>
		<td align="right" width="10%"></td>
		<td align="left" width="90%"><input type="submit" value="Upload"></td>
	</tr>	
</form>
</table>
<?php } ?>
[/code]	