[eluser]oldnews[/eluser]
I'm making use of the standardized controllers/form.php and views/myform.php routines. Having renamed 'username' to 'entrant' to 'contestant' to 'who', the problem nevertheless returns when the completed form apparently passes form validation, always on the same line #37 (
$this->email->contestant('$who')):
Fatal error: Call to undefined method CI_Email::entrant() in controllers/form.php
Code:
<?php
class Form extends Controller {
function index()
{
$this->load->helper(array('form', 'url'));
$this->load->library('form_validation');
$this->form_validation->set_rules('who', 'your name', 'required');
$this->form_validation->set_rules('mainphone', 'primary phone', 'required');
$this->form_validation->set_rules('email', 'email address', 'required|valid_email');
$this->form_validation->set_rules('extraphone', 'additional phone');
$this->form_validation->set_rules('address', 'mailing address', 'required');
$this->form_validation->set_rules('altphone', 'alternative phone');
$this->form_validation->set_rules('city', 'municipality', 'required');
$this->form_validation->set_rules('zip', 'zip code', 'required');
$this->form_validation->set_rules('description', 'describe photo', 'required');
$this->form_validation->set_rules('location', 'photo location', 'required');
$this->form_validation->set_rules('ageutresidency', 'certification checkbox', 'required');
if ($this->form_validation->run() == FALSE)
{
$this->load->view('header2');
$this->load->view('myform');
$this->load->view('footer2');
}
else
{
$this->load->library('email');
$this->email->subject('Best Summer Vacation Picture contest entry');
$this->email->to('[email protected]');
$this->email->from('$email');
$this->email->contestant('$who');
$this->email->address('$address');
$this->email->city('$city');
$this->email->zip('$zip');
$this->email->description('$description');
$this->email->location('$location');
$this->email->phone1('$mainphone');
$this->email->phone2('$extraphone');
$this->email->phone3('$altphone');
$this->email->certification('$ageutresidency');
$this->email->attach('uploads/$photofile');
$this->email->send();
echo $this->email->print_debugger();
if ( ! $this->email->send())
{
// Generate error
}
else
{
$this->load->view('header2');
$this->load->view('formsuccess');
$this->load->view('footer2');
}
}
}
}
?>
Everytime I've renamed the variable in the controllers/form.php I match the associated name change in the views/form.php
Am I dealing with a sendmail configuration issue and getting a false reference to the code in Line 37? I cannot figure this one out.