<?php
class contact_usController extends Controller
{
public function index()
{
# set a template variable
$this->registry->template->title = 'EZMVC Sample Application';
$this->registry->template->welcome = 'EZMVC Sample Application';
$this->registry->template->content = 'Please use the following form to contact us.';
$this->registry->template->copyright = 'Copyrihgt Info';
# load the index template
$this->registry->template->show('contact_us');
}
public function submit_contact()
{
# insert the contact info into the db
$this->registry->template->return_msg = $this->registry->model->run("insertContact");
# send the email
$xheaders = "";
$xheaders .= "From: hide@address.com\n";
$xheaders .= "X-Sender: hide@address.com\n";
$xheaders .= "Content-Type: text/html\n";
$xheaders .= "X-Mailer: PHP\n";
$xheaders .= "X-Priority: 3\n"; # urgent message!
$xheaders .= "BCC: hide@address.com\n";
$message = "";
$message .= "Name : " . stripslashes($_REQUEST["name"]);
$message .= "Message : " . stripslashes($_REQUEST["msg"]);
@mail("hide@address.com", "Contact Form Submittion", $message, $xheaders);
# now show the template again
#header("LOCATION: index.php?route=contact_us&msg=$return_msg");
$this->index();
}
}
?>