class Forms extends MY_Controller { public $view_data = array('page' => array()); function __construct() { parent::__construct(); $this->load->helper(array('form', 'date', 'custom_helper')); $this->load->model(array('forms_model','captcha_model')); $this->load->library(array('form_validation')); //$this->authorise(); //$this->erkanaauth->set_role_access('temp', 'admin'); } /** Auth Functions **/ private function authorise() { if($this->erkanaauth->try_session_login()) return true; redirect('/login'); return false; } // CONTACT US function contact() { $this->view_data['page']['title'] = 'Contact William Kinsey at Kinsey Racing' ; $this->view_data['page']['description'] = '' ; $this->view_data['page']['body_class'] = 'contact' ; $this->view_data['page']['page_title'] = 'Contact'; $this->view_data['page']['sub_title'] = 'Get in touch...'; $this->view_data['use_captcha'] = 0; $this->view_data['contact_success_token'] = 0; // initialise validation //$this->form_validation->set_rules('fore_name', 'Fore Name', 'required|max_length[20]|trim|xss_clean'); //$this->form_validation->set_rules('last_name', 'Last Name', 'required|max_length[30]|trim|xss_clean'); $this->form_validation->set_rules('name', 'Name', 'required|max_length[20]|trim|xss_clean'); $this->form_validation->set_rules('email', 'Email', 'valid_email|max_length[64]|trim|xss_clean'); $this->form_validation->set_rules('phone', 'Contact', 'callback_check_email_or_phone|trim|xss_clean'); $this->form_validation->set_rules('message', 'Message', 'required|trim|xss_clean'); //$this->form_validation->set_rules('confirm_captcha', 'Captcha Code', 'trim|required|xss_clean|callback_captcha_test'); $this->form_validation->set_error_delimiters('', ''); // switch off default
delimiters // Populate 'to: list' $this->view_data['dept_options'] = array( 'General Enquiry' => 'will@kinseyracing.co.uk' ); // Handle the Post if($this->input->post('submit_contact') || $this->input->post('submit_refresh')) { //echo 'Form Submit'; //$email['department'] = (string)$this->input->post('department', TRUE); $email['department'] = 'General Enquiry'; /*$email['fore_name'] = (string)$this->input->post('fore_name'); $email['last_name'] = (string)$this->input->post('last_name');*/ $email['name'] = (string)$this->input->post('name'); $email['email'] = (string)$this->input->post('email'); $email['phone'] = (string)$this->input->post('phone'); //$email['referred'] = (string)$this->input->post('referred'); $email['message'] = (string)$this->input->post('message'); } if($this->form_validation->run() == FALSE) { if($this->view_data['use_captcha']) { $captcha_ar = $this->captcha_model->generateCaptcha(); $this->session->set_userdata('captcha_word',$captcha_ar['word']); $this->view_data['captcha'] = $captcha_ar; } // return post data if(is_array($email)) $this->view_data['email'] = $email ; } else { if($this->session->userdata('captcha_word')) $this->session->unset_userdata('captcha_word'); // email headers $email['to'] = $this->view_data['dept_options'][$email['department']]; //$email['bcc'] = 'chris@six15.co.uk'; $email['from'] = $email['email']; $email['from_name'] = $email['name']; $email['subject'] = 'Website :: '.$email['department']; // assemble email body //$email['body'] = "Name: $email[fore_name] $email[last_name] \n\n" ; $email['body'] = "Name: $email[name] \n\n" ; $email['body'] .= "Email: $email[email] \n\n" ; if($email['phone']) $email['body'] .= "Telephone: $email[phone] \n\n" ; if($email['referred']) $email['body'] .= "Heard about us: $email[referred] \n\n" ; $email['body'] .= "Message: $email[message] \n\n" ; //$this->load->library('user_agent'); $base_url = $this->config->base_url(); $current_url = $this->config->base_url().uri_string(); $agent_platform = $this->agent->platform(); // Browser if ($this->agent->is_browser()) { $agent = $this->agent->browser().' '.$this->agent->version(); } elseif ($this->agent->is_robot()) { $agent = $this->agent->robot(); } elseif ($this->agent->is_mobile()) { $agent = $this->agent->mobile(); } else { $agent = 'Unidentified User Agent'; } $data['body'] .= "$agent_platform | $agent
$current_url
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/kinseyracing.co.uk/app/controllers/forms.php:1)
Filename: core/Common.php
Line Number: 442
The page you requested was not found.