Welcome Guest, Not a member yet? Register   Sign In
puzzling error msg in form validation controller
#14

[eluser]oldnews[/eluser]
To clarify, my email submit form in views follows the CI User Guide's suggested layout. I don't believe that is the problem, particularly since I have triple checked to be sure the assigned field names match the designated variables in the form validation routine. My issues continue to revolve around the email library load. My latest revised code, taking last night's advisories, is now yielding: Call to undefined method CI_Email::email_from() for line 35, though I think am observing the suggested construction under the Email Function Reference heading on the CI User Guide Email Class page:

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->email_from($email, $who);
            $this->email->reply_to($email, $who);
            $this->email->to("[email protected]");
            $this->email->message($address . ", " . $city . ", UT " . $zip . ", photo description: " . $description . ", location: " . $location . ", primary phone: " . $mainphone . ", optional secondary phone: " . $extraphone . ", optional tertiary phone: " . $altphone . ", certification of minimum age of 18 and UT residency: " . $ageutresidency);

//            $this->email->attach("/uploads/"$photofile);

            $this->email->send();

            echo $this->email->print_debugger();

            if ( ! $this->email->send())
            {
                // Generate error
            }
            else
            {
                $this->load->view('closer');
            }
        }
    }
}

// End of file: form.php
// Location: ./system/application/controllers/form.php

This is all very confusing. I suppose the undefined method referred to by the error message is distinct from the email function, but where must I direct my attention in the User Guide to grasp this nuance and do the correct coding that will generate what is billed as a simple email send process?


Messages In This Thread
puzzling error msg in form validation controller - by El Forum - 06-19-2009, 03:37 PM
puzzling error msg in form validation controller - by El Forum - 06-19-2009, 03:43 PM
puzzling error msg in form validation controller - by El Forum - 06-19-2009, 03:46 PM
puzzling error msg in form validation controller - by El Forum - 06-19-2009, 03:53 PM
puzzling error msg in form validation controller - by El Forum - 06-19-2009, 03:58 PM
puzzling error msg in form validation controller - by El Forum - 06-19-2009, 04:01 PM
puzzling error msg in form validation controller - by El Forum - 06-19-2009, 04:03 PM
puzzling error msg in form validation controller - by El Forum - 06-19-2009, 04:06 PM
puzzling error msg in form validation controller - by El Forum - 06-19-2009, 10:17 PM
puzzling error msg in form validation controller - by El Forum - 06-19-2009, 10:21 PM
puzzling error msg in form validation controller - by El Forum - 06-20-2009, 03:53 AM
puzzling error msg in form validation controller - by El Forum - 06-20-2009, 04:09 AM
puzzling error msg in form validation controller - by El Forum - 06-20-2009, 04:19 AM
puzzling error msg in form validation controller - by El Forum - 06-20-2009, 11:14 AM
puzzling error msg in form validation controller - by El Forum - 06-20-2009, 11:56 AM
puzzling error msg in form validation controller - by El Forum - 06-20-2009, 01:44 PM
puzzling error msg in form validation controller - by El Forum - 06-20-2009, 06:58 PM
puzzling error msg in form validation controller - by El Forum - 06-21-2009, 05:19 AM
puzzling error msg in form validation controller - by El Forum - 06-21-2009, 05:52 AM
puzzling error msg in form validation controller - by El Forum - 06-21-2009, 06:31 AM
puzzling error msg in form validation controller - by El Forum - 06-21-2009, 07:24 AM
puzzling error msg in form validation controller - by El Forum - 06-21-2009, 07:37 AM
puzzling error msg in form validation controller - by El Forum - 06-21-2009, 08:03 AM



Theme © iAndrew 2016 - Forum software by © MyBB