loadTemplatefile("tpl_contact.html");
include_once("header.php"); // show header
include_once("menu.php"); // show menu
include_once("base.php"); // show footer
//include_once("info.php"); // show info
// if mail send was clicked -> validate
if($_POST['vf_accept']){
include_once("$vc_includes_folder/validacion.php");
$vf_message_error = '';
// here validate names
if($_POST['vf_name'] == ''){
$vf_message_error .= "Invalid name
";
}
// here validate emails
if($_POST['vf_email'] == '' ||
!is_email($_POST['vf_email'])){
$vf_message_error .= "Invalid email
";
}
// here validate quesitions
if($_POST['vf_question'] == ''){
$vf_message_error .= "Invalid question
";
}
// if there was not errors -> send mail and go to thanks pages
if($vf_message_error == ''){
include_once("$vc_includes_folder/mail.php");
$message .= "Name: $_POST[vf_name]
";
$message .= "Email: $_POST[vf_email]
";
$message .= "Comment: $_POST[vf_question]
";
//mandar_mail("anibalalegre@gmail.com", "New Contact", $_POST[vf_email],$_POST[vf_email],'',"$message");
mandar_mail("tetsu@visualscope.com", "New Contact", $_POST[vf_email],$_POST[vf_email],'',"$message");
header("location:contact_success.html");
die();
}
}
//Set template values
$template->setVariable("error", $vf_message_error);
$template->setVariable("vf_name", $_POST[vf_name]);
$template->setVariable("vf_email", $_POST[vf_email]);
$template->setVariable("vf_question", $_POST[vf_question]);
$template->show();
die();
?>