Skip to content

Instantly share code, notes, and snippets.

@martisj
Created April 24, 2014 07:04
Show Gist options
  • Save martisj/11244399 to your computer and use it in GitHub Desktop.
Save martisj/11244399 to your computer and use it in GitHub Desktop.
email validation form
public function request_a_demo() {
$data = array();
$data['for_universities_section'] = TRUE;
$this->form_validation->set_rules('name', 'Name', 'trim|required');
$this->form_validation->set_rules('institution', 'University/College', 'trim|required');
$this->form_validation->set_rules('position', 'Position', 'trim|required');
$this->form_validation->set_rules('email', 'Email', 'trim|required|valid_email');
if ($this->form_validation->run() == FALSE)
{
$this->template->set_layout('public')->build('home/request_a_demo', $data);
}
else
{
die(var_dump($_POST));
$this->template->set_layout('public')->build('home/request_a_demo_sent', $data);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment