$target_path = "/home/path/to/uploadfolder/";
$target_path = $target_path . basename( $_FILES['picture']['name']);
if(!empty($_FILES['picture']['tmp_name'])){
$types = array('image/gif', 'image/jpg', 'image/jpeg', 'image/png', 'image/bmp', 'image/JPG', 'image/pjpeg', 'image/GIF');
$size = getimagesize($_FILES['picture']['tmp_name']);
if(in_array($size['mime'], $types))
{
if(move_uploaded_file($_FILES['picture']['tmp_name'], $target_path)){
if(move_uploaded_file($_FILES['picture']['tmp_name'], $target_path)){
//it's valid and moved
}
}
}
How's that look then?