public function _submit() { $f = $_POST; $app = new WoodwindApply($f); list($required, $filled, $percent) = $app->progress(); $_SESSION['woodwind-day']['f'] = $app->form(); if ($percent < 1) { $_SESSION['errors'][] = 'Please fill in all required fields.'; PSU::redirect($GLOBALS['BASE_URL'] . '/register'); } if ($id = $app->save()) { WoodwindAPI::mail($id); } else { $_SESSION['errors'][] = 'There was an error saving your submission data.'; PSU::redirect($GLOBALS['BASE_URL'] . '/register'); } PSU::redirect($GLOBALS['BASE_URL'] . '/thank-you'); }