input->cookie("ff_language")==FALSE)){ $this->language = $this->input->cookie("ff_language"); }elseif($this->uri->segment(1)=="en"){ $this->language = "en"; }else{ $this->language = "pt"; } } function index() { if($this->language=="pt"){ $array_title = array('title' => "Contacto"); }elseif ($this->language=="en"){ $array_title = array('title' => "Contact"); }else{ $array_title = array(); } $this->load->model('sistema'); $this->load->view($this->language.'/sys/header', $array_title); $this->load->view($this->language.'/contacto'); $this->load->view($this->language.'/sys/footer'); } function sucess(){ $this->load->model('sistema'); $this->load->view($this->language.'/sys/header'); $this->load->view($this->language.'/contacto', array("sucess" => true)); $this->load->view($this->language.'/sys/footer'); } function repeated(){ $this->load->model('sistema'); $this->load->view($this->language.'/sys/header'); $this->load->view($this->language.'/contacto', array("repeated" => true)); $this->load->view($this->language.'/sys/footer'); } function send(){ if($this->input->valid_ip($_SERVER['REMOTE_ADDR']) && $this->input->cookie('stall') != md5(print_r($this->input->post(NULL, TRUE),true))){ $this->input->set_cookie(array('name'=>'stall','value'=>md5(print_r($this->input->post(NULL, TRUE),true)),'expire'=>60*60*24*365)); #VALIDATION $this->load->helper(array('form', 'url')); $this->load->library('form_validation'); $this->form_validation->set_rules('nome', 'Nome', 'required'); $this->form_validation->set_rules('email', 'E-mail', 'required|valid_email'); $this->form_validation->set_rules('telemovel', 'Telemóvel', 'required'); $this->form_validation->set_rules('local', 'Localização', 'required'); $this->form_validation->set_rules('contacto_message', 'Mensagem', 'required'); #campos $campos = $this->input->post(NULL, TRUE); #http://ellislab.com/codeigniter/user-guide/libraries/form_validation.html $this->load->library('email'); #CONFIG EMAIL 1º email $config['protocol'] = 'smtp'; # $config['smtp_host'] = 'smtpout.europe.secureserver.net'; $config['smtp_user'] = 'centroescutista@fontefrade.com'; $config['smtp_pass'] = 'esquiloff123'; # $config['wordwrap'] = TRUE; $this->email->initialize($config); if ($this->form_validation->run() == FALSE) { echo validation_errors(); echo "Se a verificacao dos dados estiver incorrecta por favor contacte-nos pelo email: centroescutista@fontefrade.com"; $this->email->from("no-reply@fontefrade.com", $campos["nome"]); $this->email->to('centroescutista@fontefrade.com'); $this->email->reply_to($campos["email"], $campos["nome"]); $this->email->subject('Contacto - Quinta Fonte Frade [ERRO]'); $this->email->message("Nome: ".$campos["nome"]."\nEmail: ".$campos["email"]."\nTelemóvel: ".$campos["telemovel"] ."\nLocalidade: ".$campos["local"]."\n\nMensagem: ".$campos["contacto_message"]."\n\n\nDetalhes: ".$_SERVER["REMOTE_ADDR"]); $this->email->send(); } else { $this->email->from("no-reply@fontefrade.com", $campos["nome"]); $this->email->to('centroescutista@fontefrade.com'); $this->email->reply_to($campos["email"], $campos["nome"]); $this->email->subject('Contacto - Quinta Fonte Frade'); $this->email->message("Nome: ".$campos["nome"]."\nEmail: ".$campos["email"]."\nTelemóvel: ".$campos["telemovel"] ."\nLocalidade: ".$campos["local"]."\n\nMensagem: ".$campos["contacto_message"]."\n\n\nDetalhes: ".$_SERVER["REMOTE_ADDR"]); $this->email->send(); header("Location: ".base_url()."contacto/sucess"); } }else{ header("Location: ".base_url()."contacto/repeated"); } } } ?>

A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /var/www/site/app-get/controllers/contacto.php:109)

Filename: core/Common.php

Line Number: 442

404 Page Not Found

404 Page Not Found

The page you requested was not found.