form_dropdown() return undefined |
[eluser]Zied[/eluser]
controller:navigation
function:contact_submit
Code: function contact_submit() {
//load form validation
$this->load->library('form_validation');
//set form rules
$this->form_validation->set_rules('name', 'name', 'required|max_length[50]');
$this->form_validation->set_rules('email', 'Email', 'required|min_length[6]|valid_email');
//run form validation
$success = $this->form_validation->run();
//Test ouput of form_dropdown()
echo $subject = $this->input->post('subject');
//if the validation was a success
if ((IS_AJAX && $success) || (!IS_AJAX && $success))
{
$this->load->library('email');
$config['charset'] = 'utf-8';
$config['mailtype'] = 'html';
$this->email->initialize($config);
$this->email->set_newline("\r\n");
$this->email->from($this->input->post('email'), $this->input->post('name'));
$this->email->to('[email protected]');
$this->email->subject($this->input->post('subject'));
$this->email->message(
'Le nom de l\'expéditeur: '.$this->input->post('name').'<br>'.
'L\'email de l\'expéditeur: '.$this->input->post('email').'<br>'.
'Type de l\'email: '.$this->input->post('subject').'<br>'.
'Le méssage: '.$this->input->post('message'));
if($this->email->send())
{
echo 'Your email was sent, fool.';
}
else
{
echo 'Your email was not sent.';
}
}
//if validation failed
else { echo '<br>'.strip_tags(validation_errors()); }
}
|
Messages In This Thread |
form_dropdown() return undefined - by El Forum - 05-13-2010, 05:53 AM
|