I understand that security issues usually come from user inputs which is why I am assuming there is a security hole in the else part of $eFlag!=1.
I am not familiar with php so I am not 100% sure what is going on here.
I am assuming that file itself that is being uploaded could be some malicious executable and that is not being checked???
If so, is there ways to prevent uploading executable or just upload .doc files (looks like that’s the file that the program wants)?
***This was posted on one of the clubs that I am in for school and asked to identify a security hole (in another words, there is one for sure).

You should check mime types of uploaded file:
Full example on php.net for checking mime types: http://php.net/manual/en/function.mime-content-type.php
Full code with added filter of filename name and length (this is based on filename):
You can dump and use conditionals to check mimetypes as examples:
Notice: mime types can be faked, so i will check via filename, types via $_FILES, length of filename, and read first lines of code to check if DOC or something else. Open it doc in notepad and see what you can check in PHP by reading file.