Hi!
My code doesn't work properly. It is suppose to ONLY pass through files with the extensions 'pjpg','gif','pjpeg','x-png','png','jpg','jpeg'. Where do I go wrong?
$filenames = $_FILES['image']['type'];
$filenamear = explode("/",$filenames);
$exten = $filenamear[1];
$allowed = array('pjpg','gif','pjpeg','x-png','png','jpg','jpeg');
if (!in_array($exten,$allowed)) { // $exten is the variable with the extension
$errormessage .= 'You didn't add an imagefile (jpg,gif eller png)<br>';
$fault = true;
}
if($fault) {
die("<p>$errormessage <br /><br /><strong>Please correct the faults and try again.</strong></p>");
}