PHP Upload limit image type to JPG and Gif?

Im trying to upload only gif and jpg filetypes.

I can do it by getting the extension from the php susbtr function, but i would like to do it the correct way?

Here is the code and it works for either gif or jpeg but i can seem to get the syntax correct for both i tried

if ($uploaded_type != ("image/jpeg") | ("image/gif"){ along with a few other combos. Whats the correct way to do this?

Here is the current bit of code...

if ($uploaded_type != ("image/jpeg"){
echo "This type of picture is no allowed. Please upload and try again!<br>";
$ok=0;
}

Thanks Sitepoint!