Ive been experimenting with the upload capability of php, I have been looking at this tutorial on w3school.
http://www.w3schools.com/php/php_file_upload.asp
I agree with answer of Ivo but I think that you may make change of next piece of code like this:
$typePicture = array('jpg','png','jpeg','gif');
// Allow certain file formats
if($typePicture[0] != "jpg" || $typePicture[1] != "png" || $typePicture[2] != "jpeg" || $typePicture[3] != "gif" )
{
echo "Sorry, only JPG, JPEG, PNG & GIF files are allowed.";
$uploadOk = 0;
}