I have included a code in my php form for attaching files, please find the code below. In my code I have mentioned to only to accept *.doc, *.docx and *.pdf but its accepting all the extensions
function checkType() {
if(!empty($_FILES['fileatt']['type'])){
if(($_FILES['fileatt']['type'] != "application/msword")||($_FILES['fileatt']['type'] != "application/vnd.openxmlformats-officedocument.wordprocessingml.document")||($_FILES['fileatt']['type'] != "application/pdf")) {
echo "Sorry, current format is <b> (".$_FILES['fileatt']['type'].")</b>, only *.doc, *.docx and *.pdf are allowed." ;
}
}
}