Could not think of a a better title for this question. Anyways here is the problem.
I have a simple contact form. If the user goes to that page and enters wrong info (no email or message) then everything seems to work. I get the validation errors. But if they put the wrong information in say 6 times in a row, then click the browsers "back" button. They do not go to the previous page. They have to click 6 or 7 times to return to previous page. Am I doing something wrong?
class Contact extends CI_Controller {
function index()
{
$data['title'] = "Contact Us";
$data['main'] = 'contact';
$this->form_validation->set_rules('email', 'Email', 'required|valid_email');
$this->form_validation->set_rules('message','Message','required');
if ($this->form_validation->run() == FALSE)
{
$this->load->vars($data);
$this->load->view('template');
}
else
{
$contactdata['username'] = $this->input->post('email');
$contactdata['title'] = "Contact Success";
$contactdata['main'] = 'contactsuccess';
$this->load->vars($contactdata);
$this->load->view('template');
}
}