include('library/connexion.php') ;
include('library/fonction.php') ;
$send= "f";
if($_POST) {
//set variables
$name = trim($_POST['name']);
$emailTo = trim("nicolas@mavil.be");
$email = trim($_POST['email']);
$message = trim($_POST['message']);
//Check to make sure sure that a valid email address is submitted
if($email == '') {
$send= "f";
} else if (!eregi("^[A-Z0-9._%-]+@[A-Z0-9._%-]+.[A-Z]{2,4}$", $email)) {
$send= "f";
} else {
//Send mail
$body = "$name
$message";
$subject = "Contact mavil.be";
$headers = "From: ".$email."\nContent-Type: text/html; charset=iso-8859-1\n";
if (mail($emailTo, $subject, $body, $headers)) {
$send= "T";
}
else {
$send= "f";
}
}
}
$SQL='SELECT title_'.$lng.' as title,content_'.$lng.' as content FROM mavil_page
where idPage= '.$idpage;
$Tnews = mysql_query($SQL, $cnx)or die(mysql_error());
if(mysql_num_rows($Tnews)>0){
$Rnews=mysql_fetch_object($Tnews);
$id=$Rnews->id;
$title=$Rnews->title;
$content=$Rnews->content;
}
mysql_free_result($Tnews);
?>