Codeigniter Form validation problem
- by ben robinson
Please please please can someone help me
$this-load-library('form_validation');
$this-load-helper('cookie');
$data = array();
if($_POST) {
// Set validation rules including additional validation for uniqueness
$this-form_validation-set_rules('yourname', 'Your Name', 'trim|required');
$this-form_validation-set_rules('youremail', 'Your Email', 'trim|required|valid_email');
$this-form_validation-set_rules('friendname', 'Friends Name', 'trim|required');
$this-form_validation-set_rules('friendemail', 'Friends Email', 'trim|required|valid_email');
// Run the validation and take action
if($this-form_validation-run()) {
echo 'valid;
}
}
else{
echo 'problem';
}
Form validation is coming back with no errors can cany one see why?