Welcome Guest, Not a member yet? Register   Sign In
Php errors
#3

[eluser]pigfox[/eluser]
<?php

class Contact extends Controller
{

public function __construct()
{
parent::__construct();
}

function index()
{
$this->load->helper('form');
$this->load->view('header');
$this->load->view('contact_form');
$this->load->view('footer');
}

function send()
{
$this->load->library('email');
$name = $this->input->post('name', TRUE);
$email = $this->input->post('email2', TRUE);
$message = $this->input->post('message', TRUE);
$result= 'Your message was NOT sent';

if(isset($name) && isset($email) && isset($message))
{
$this->email->from($email, $name);
$this->email->to('[email protected]');
$this->email->subject($name.' sent you a msg from domain.com');
$message="Name $name\nEmail $email\nMessage $message";
$this->email->message($message);
$this->email->send();
$result= 'Thank you '.$name.', your message was NOT sent';
}

$this->load->view('header');
$this->load->view('send', $result);
$this->load->view('footer');
}

}
/* End of file contact.php */
/* Location: ./system/application/controllers/contact.php */

Views/send.php
<h3>
&lt;?
echo $result;
?&gt;
</h3>


Messages In This Thread
Php errors - by El Forum - 03-08-2010, 09:45 PM
Php errors - by El Forum - 03-08-2010, 09:58 PM
Php errors - by El Forum - 03-08-2010, 10:02 PM
Php errors - by El Forum - 03-09-2010, 04:56 AM
Php errors - by El Forum - 03-09-2010, 10:14 AM
Php errors - by El Forum - 03-09-2010, 10:28 AM
Php errors - by El Forum - 03-09-2010, 10:42 AM
Php errors - by El Forum - 03-09-2010, 10:45 AM
Php errors - by El Forum - 03-09-2010, 10:51 AM
Php errors - by El Forum - 03-09-2010, 11:07 AM



Theme © iAndrew 2016 - Forum software by © MyBB