public function post_redirect($url = null) { $result = $this->get(); if ($this->submitted) { if (!$this->success) { // Store the form values in the session prior to redirection so that they can be re-displayed $_SESSION['forms'][$this->control_id()]['error_data'] = $this->get_values(); } if (empty($url)) { $url = $_SESSION['forms'][$this->control_id()]['url']; } Utils::redirect($url); } return $result; }