$result = $pic2["name"]; } else { if (move_uploaded_file($pic2["tmp_name"], $file)) { $result = $pic2["name"]; } } } return $result; } try { ini_set("display_errors", 1); $connection = DB::getConnection(DB::host, DB::database, DB::user, DB::password); //gets the user id and searches the member table for matching id $id = $_SESSION["id"]; $table = new employerTable($connection); $employer = $table->findById($id); if (isset($_POST['submit'])) { $company = filter_var($_POST['company'], FILTER_SANITIZE_FULL_SPECIAL_CHARS); $fName = filter_var($_POST['fName'], FILTER_SANITIZE_FULL_SPECIAL_CHARS); $lName = filter_var($_POST['lName'], FILTER_SANITIZE_FULL_SPECIAL_CHARS); $email = filter_var($_POST['email'], FILTER_SANITIZE_FULL_SPECIAL_CHARS); $location = filter_var($_POST['location'], FILTER_SANITIZE_FULL_SPECIAL_CHARS); $bio = filter_var($_POST['bio'], FILTER_SANITIZE_FULL_SPECIAL_CHARS); $password = filter_var($_POST['password'], FILTER_SANITIZE_FULL_SPECIAL_CHARS); $picture = $_FILES['picture']; if ($picture === null) { $picture = $employer->getPicture(); } else { $picture = uploadPicture($picture); } }