upload photo limits

Posted on 16th Feb 2014 by admin

ive got a upload photo script and im just trying to make more secure currently it limits size and as you can see from my code below it limits only gif and php files

how do i edit my code to limit all these or do i have to copy and paste the same code and change the file extention?
jpg, jpeg, pjpeg, PJPEG, JPG, JPEG, gif, GIF, png, PNG

Code: if (!($uploaded_type=="image/gif")) {
echo "You may only upload GIF files.
";
$ok=0;
}

also ive restricted php is there anything else i need to restrict?
Code: if ($uploaded_type =="text/php")
{
echo "No PHP files
";
$ok=0;
}

Other forums