@STerliakov gets the credit for the answer:
Apparently, this section of the code in its entirety was added for the purpose so the user would see the data for troubleshooting purpose.
I deleted it entirely and that fixed the issue
requirePOST();
[$uploaded_files, $file_messages] = $this->saveFiles();
Flash::set('debug','Application form data '
. json_encode($_POST, JSON_PRETTY_PRINT)
. "\nUploaded files:"
. json_encode($uploaded_files,JSON_PRETTY_PRINT)
. "\nFile messages:"
. json_encode($file_messages,JSON_PRETTY_PRINT)
);
For anyone else experiencing the issue, here is the entire working function
public function submit() {
include([DB ACCESS FILE]);
$fp1 = json_encode($_POST, JSON_PRETTY_PRINT);
$fp2 = json_decode($fp1);
$owner_first = $fp2->owner_first;
$owner_last = $fp2->owner_last;
$query_insert_cl = "INSERT INTO cnvloans (owner_first,owner_last) VALUES ('$owner_first','$owner_last')";
mysqli_query($dbc, $query_insert_cl);
redirect('/page/confirm');
}