Advertisement
Guest User

contact controller

a guest
Jan 30th, 2012
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.93 KB | None | 0 0
  1. <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  2.  
  3. class Contact extends CI_Controller {
  4.    
  5.     function index () {
  6.         $data = array('title' => 'Request Assistance', 'main_content' => 'pages/contact');
  7.         $this->load->view('template/main', $data);
  8.     }
  9.    
  10.     function sendFacilityForm () { 
  11.         $name = $this->input->post('name');
  12.         $email = $this->input->post('email');
  13.         $inquiry = $this->input->post('inquiry');
  14.        
  15.         $this->email->from('xxx@xxx.org', 'Clay Beyer');
  16.         $this->email->to($email);
  17.         $this->email->subject('Facility Manager has a new Message!');
  18.         $this->email->message($inquiry);
  19.        
  20.         if($this->email->send()) {
  21.             $data = array('title' => 'Form Submitted', 'main_content' => 'pages/formSuccess');
  22.             $this->load->view('template/main', $data);
  23.         }
  24.         else {
  25.             show_error($this->email->print_debugger());
  26.         }
  27.     }
  28.  
  29. }
  30. /*End of file contact.php*/
  31. /*Location .application/controllers/contact.php*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement