答案 0 :(得分:0)
以观看方式
<?php echo form_label('Student Email :'); ?> <?php echo form_error('semail'); ?>
<?php echo form_input(array('id' => 'demail', 'name' => 'semail')); ?>
在控制器中
$this->load->library('form_validation');
// Validation For Email Field
$this->form_validation->set_rules('semail', 'Email', 'required|valid_email');
if ($this->form_validation->run() == FALSE)
{
$this->load->view('formview');
}
else
{
$this->load->view('homeview');
}