Welcome Guest, Not a member yet? Register   Sign In
Send File by Email through Form on Web Site?
#10

[eluser]invision[/eluser]
Hi,

OK, I've managed to submit the form when attaching the file, but I now get these 2 errors when submitted:

Code:
A PHP Error was encountered

Severity: Warning

Message: Missing argument 1 for apply()

Filename: controllers/vacancies.php

Line Number: 38

and

Code:
A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at ....system/libraries/Exceptions.php:166)

Filename: helpers/url_helper.php

Line Number: 541


The new Controller code is as follows:

Controller
Code:
function apply($slug){
  
    $data['page_data'] = $this->MVacancies->getVacancyItem($slug);
    $data['page_data'] or redirect('vacancies/');
    
    $data['title'] = $data['page_data']['title'];
    $data['body'] = $data['page_data']['body'];
    
      if(isset($_FILES['file']['name'])) {
      
              $email = 'Job Seeker';
              
        $file_name = $this->_do_upload(); // _do_upload() should return the path and name of the uploaded file
        $this->email->attach($file_name);
        
              $message = "$email has applied for this job.";
              $this->email->from($email, '[email protected]');
              $this->email->to('[email protected]');
              
              $this->email->subject('Application for Job #' . $id);
              $this->email->message($message);
              
              $this->email->send();
              
              $this->load->view('form_success');
              
          } else {
          
        $data['main'] = 'vacancies_apply';
        $this->load->vars($data);    
        $this->load->view('template');
        
      }
    
  }

I think I see the finishing lines.

Can you tell me if I've missed anything obvious?



Thanks again


Messages In This Thread
Send File by Email through Form on Web Site? - by El Forum - 05-11-2010, 03:33 AM
Send File by Email through Form on Web Site? - by El Forum - 05-11-2010, 04:15 AM
Send File by Email through Form on Web Site? - by El Forum - 05-11-2010, 04:23 AM
Send File by Email through Form on Web Site? - by El Forum - 05-11-2010, 07:55 AM
Send File by Email through Form on Web Site? - by El Forum - 05-11-2010, 08:04 AM
Send File by Email through Form on Web Site? - by El Forum - 05-11-2010, 08:11 AM
Send File by Email through Form on Web Site? - by El Forum - 05-11-2010, 05:11 PM
Send File by Email through Form on Web Site? - by El Forum - 05-12-2010, 07:59 AM
Send File by Email through Form on Web Site? - by El Forum - 05-12-2010, 08:15 AM
Send File by Email through Form on Web Site? - by El Forum - 05-12-2010, 08:26 AM
Send File by Email through Form on Web Site? - by El Forum - 05-13-2010, 01:51 AM
Send File by Email through Form on Web Site? - by El Forum - 05-13-2010, 03:01 AM
Send File by Email through Form on Web Site? - by El Forum - 05-13-2010, 03:28 AM
Send File by Email through Form on Web Site? - by El Forum - 05-13-2010, 12:05 PM
Send File by Email through Form on Web Site? - by El Forum - 05-14-2010, 06:26 AM
Send File by Email through Form on Web Site? - by El Forum - 05-14-2010, 06:34 AM
Send File by Email through Form on Web Site? - by El Forum - 05-14-2010, 02:08 PM
Send File by Email through Form on Web Site? - by El Forum - 05-14-2010, 02:59 PM
Send File by Email through Form on Web Site? - by El Forum - 05-14-2010, 03:02 PM
Send File by Email through Form on Web Site? - by El Forum - 05-14-2010, 03:04 PM
Send File by Email through Form on Web Site? - by El Forum - 05-14-2010, 03:42 PM
Send File by Email through Form on Web Site? - by El Forum - 05-17-2010, 02:36 AM
Send File by Email through Form on Web Site? - by El Forum - 05-17-2010, 03:55 AM
Send File by Email through Form on Web Site? - by El Forum - 05-17-2010, 04:16 AM
Send File by Email through Form on Web Site? - by El Forum - 05-17-2010, 06:39 AM



Theme © iAndrew 2016 - Forum software by © MyBB