session_start();
while(list($key,$value) = each($_GET)) {
$$key = $value ;
}
include "cgi-bin/main_cfg.php";
include "cgi-bin/appfunctions.php";
include "cgi-bin/functions.php";
$coordenadas=tabvalor('valor',$tbvar,'id','contactos');
$openprod=tabvalor('valor',$tbvar,'id','openprod');
$coordenadasa=tabvalor('valor',$tbvar,'id','contactosa');
switch ($lang) {
case 'SP':
$title="Vihume - Vigilancia Humana de Monitorización Electrónica";
$inc1="menu_sp.php";
$deco01="deco_01_sp.gif";
$deco02="deco_03_sp.gif";
$deco03="deco_04_contactos_sp.gif";
$labela="¡Gracias por su visita a la página ".$sitename."!";
$labelb="Su comentario será analizado y si necesitase respuesta, nos pondremos en contacto con usted lo mas brevemente posible.
Datos processados:";
$labelc="Código";
$labeld="Validación";
$labele="(escribe el código)";
$labelf="Ha introducido un código incorrecto. Por favor";
$labelg="try again";
$msg="CONTACTE VIHUME";
$ptit="VIHUME, LDAª";
$tit="FORMULÁRIO CONTACTOS";
$label1="Assunto";
$label2="Mensaje";
$label3="Nombre";
$label4="Diréccion";
$label5="País";
$opcao1="Contacto comercial";
$opcao2="Contacto técnico";
$opcao3="Otros";
$labelbotao="enviar";
$valida="Tiene que escribir una mensage!";
break;
case 'UK':
$title="Vihume - Human Surveillance with Electronic Monitorization";
$inc1="menu_uk.php";
$deco01="deco_01_uk.gif";
$deco02="deco_03_uk.gif";
$deco03="deco_04_contactos_uk.gif";
$labela="Thanks for you visit to ".$sitename." site!";
$labelb="Your message will be taken into consideration. If you require a reply we will get in touch as soon as possible.
Data sent:";
$labelc="Code";
$labeld="Validation";
$labele="(enter code)";
$labelf="You have entered the wrong code. Please";
$labelg="try again";
$msg="CONTACT VIHUME";
$ptit="VIHUME, LDAª";
$tit="CONTACTS FORM";
$label1="Subject";
$label2="Message";
$label3="Name";
$label4="Address";
$label5="Country";
$opcao1="Sales contact";
$opcao2="Technical contact";
$opcao3="Other";
$labelbotao="send";
$valida="Fields marqued with «*» are required! Please verify the e-mail";
break;
default:
$title="Vihume - Vigilância Humana de Monitorização Electrónica";
$inc1="menu_pt.php";
$deco01="deco_01_pt.gif";
$deco02="deco_03_pt.gif";
$deco03="deco_04_contactos_pt.gif";
$labela="Obrigado pela sua visita ao site ".$sitename."!";
$labelb="A sua mensagem será analisada e se esta carecer de resposta, será contactado o mais brevemente possível.
Dados processados:";
$labelc="Código";
$labeld="Validação";
$labele="(introduza código)";
$labelf="O codigo de validação não foi introduzido correctamente. Por favor";
$labelg="tente de novo";
$msg="CONTACTE A VIHUME";
$ptit="VIHUME, LDAª";
$tit="FORMULÁRIO DE CONTACTOS";
$label1="Assunto";
$label2="Mensagem";
$label3="Nome";
$label4="Morada";
$label5="País";
$opcao1="Contacto comercial";
$opcao2="Contacto técnico";
$opcao3="Outro";
$labelbotao="enviar";
$valida="Os campos assinalados com «*» são de preenchimento requerido! Verifique o e-mail.";
}
?>
echo "$title"; ?>
" width="172" height="103">
" width="239" height="163">
" width="157" height="163">
require $inc1;
?>
outputmenu($fam,$cat,$lang);
?>
echo "$msg"; ?>
echo "$ptit"; ?> echo "$coordenadasa"; ?>
// check for posted form
if (isset($_POST['B1'])) {
// see if the code the user typed matched the generated code
if (strtoupper($_POST['code']) == $_SESSION['code']) {
//echo 'Congratulations, you entered the correct code.';
while(list($key,$value) = each($_POST)) {
$$key = $value ;
}
//Application variables
$txtfilename = "cgi-bin/file001.txt";
$toemail = tabvalor('valor',$tbvar,'id','email1');
//$toemail = "info@otuoc.com";
$fromemail = $toemail;
$subject = "Formulario Contactos Online";
$messageheader = "Dados introduzidos no formulario de contactos\n"."---------------------------------------------\n";
$data = gmdate("d/m/Y H:i:s");
$messagemail = $messageheader."\nData: ".$data."\nAssunto: ".$Assunto."\nNome: ".$Nome."\nE-mail: ".$Email."\nTel.: ".$Tel."\nMorada: ".$Morada."\nC.P. : ".$Cp."\nPais: ".$Pais."\n\nMensagem:\n".$Mensagem;
$messagefile = "$Assunto|$Nome|$Email|$Tel|$Morada|$Cp|$Mensagem|$Pais|$data\n";
mail("$toemail","$subject","$messagemail","From: $fromemail");
$textfile=fopen($txtfilename,"a");
fputs($textfile, $messagefile);
fclose($textfile);
print("