使用PHP发布输入文件问题,将文件名插入我的数据库,并将相同的文件上传到我的服务器文件

i'm currently creating a platform for some college work where users can create a profile and then edit that profile whether that be to change their name, username or bio but also giving them the option to upload a profile picture. I have been using a textbook to help guide me through the majority of my work which has been helpful. However, the way in which it is telling me to save and upload the users selected image doesn't seem to be work despite me following the textbook down to the letter. The user should in theory be able to upload their selected image which then would upload into my server in a specific folder and then the file name of that would be uploaded to my database. However, neither of these are currently happening despite the rest of the edit page working and getting now errors.

I think it maybe a problem with the if statement: if( isset( $POST['profile_picture'])) from the code directly below. However, I am unsure.

Below I have placed the section code from my file profileinformationcontroller.php which processes the information submitted from the form on edit.tpl.php which I have place below. As well as, these too I also have an imagemanager.class.php which handles the actual image submitted ensuring it is in the right format and size.

/*profileinformationcontroller.php*/
/*The below section of code is what handle the submitted data from the form I have listed a little but further down*/


private function editProfile() {
    if( $this->registry->getObject('authenticate')->isLoggedIn() == true ) {

            $user = $this->registry->getObject('authenticate')->getUser()->getUserID();

            if( isset( $_POST ) && count( $_POST ) > 0 ) {

                // edit form submitted
                $profile = new Profile( $this->registry, $user );
                $profile->setBio( $this->registry->getObject('db')->sanitizeData( $_POST['bio'] ) );
                $profile->setName( $this->registry->getObject('db')->sanitizeData( $_POST['name'] ) );
                $profile->setUserName( $this->registry->getObject('db')->sanitizeData( $_POST['user_name'] ) );
                $profile->setUserSport( $this->registry->getObject('db')->sanitizeData( $_POST['user_sport'] ) );
                $profile->setUserGender( $this->registry->getObject('db')->sanitizeData( $_POST['user_gender'] ), false );
                $profile->setUsersDOB( $this->registry->getObject('db')->sanitizeData( $_POST['users_dob'] ), false );

                if( isset( $_POST['profile_picture'] ) ) {
                    require_once( FRAMEWORK_PATH . 'lib/images/imagemanager.class.php' );
                    $im = new Imagemanager();
                    $im->loadFromPost( 'profile_picture', $this->registry->getSetting('uploads_path') .'profile/');

                    if( $im == true ) {
                        $im->resizeScaleHeight( 150 );
                        $im->save( $this->registry->getSetting('uploads_path') .'profile/' . $im->getName() );
                        $profile->setPhoto( $im->getName() );
                    }
                }

                $profile->save();
                $this->registry->redirectUser( array('profile', 'view', 'edit' ), 'Profile saved', 'The changes to your profile have been saved', false );

             } else {
                 // edit form
                 $this->registry->getObject('template')->buildFromTemplates( 'header.tpl.php', 'profile/information/edit.tpl.php', 'footer.tpl.php' );

                 // get the profile information to pre-populate the form fields
                 require_once( FRAMEWORK_PATH . 'models/profile.php' );
                 $profile = new Profile( $this->registry, $user );
                 $profile->toTags( 'p_' ); 
         }

   } else {
         $this->registry->errorPage('Please login', 'You need to be logged in to edit your profile');
         }
}




/*edit.tpl.php*/
/*This is the form for the edit page where profile_picture is inserted*/

<h1>Edit Profile</h1>
    <form action="profile/view/{p_user_id}/edit" method="post" enctype="multipart/form-data">
            <label for="name"><h4>Name</h4></label>
            <input type="text" class="form-control" placeholder="Full Name" id="name" name="name" value="{p_name}" />
        <label for="profile_picture"><h4>Photograph</h4></label>
            <input type="file" id="profile_picture" name="profile_picture" />
        <label for="bio"><h4>Biography</h4></label>
            <textarea id="bio" name="bio" class="form-control" placeholder="Brief description of who you are"  cols="40" rows="6">{p_bio}</textarea>
        <label for="user_name"><h4>Full Name</h4></label>
            <input type="text" class="form-control" placeholder="Full Name" id="user_name" name="user_name" value="{p_user_name}" />
        <label for="user_sport"><h4>Activity type</h4></label>
            <input class="form-control" placeholder="Full Name"  type="text" id="user_sport" name="user_sport" value="{p_user_sport}" />
        <input type="submit" class="btn-lg" style="width:100%;" id="" name="" value="Save profile" />
    </form>

Any help would be really appreciated, as I am really stumped on what is actually going wrong. I have read that possibly I should be using $_FILES instead of $_POST on the profile_picture if statement, but I'm a little unsure how that would work. Thank you.