require 'class.phpmailer.php';
include('layout/layout.inc.php');
if ($_POST[action]=="parseContact")
{
if ($_POST[name] && $_POST[address] && $_POST[zipcode] && $_POST[city] && $_POST[phone] && $_POST[email] && $_POST[comment])
{
if ($_POST['email']!="" && preg_match("/^[a-z0-9]+([_\\.-][a-z0-9]+)*@([a-z0-9]+([\.-][a-z0-9]+)*)+\\.[a-z]{2,}$/i", $_POST['email']))
{
$text = "";
$text .= "Beste ".$_POST[name].",
";
$text .= "Bedankt voor het invullen van het contactformulier op onze website.
";
$text .= "Wij nemen spoedig contact met u op.
";
$text .= "Met vriendelijke groet,
";
$text .= "Crommentuyn
";
$text .= "Naam: ".$_POST[name]."
";
$text .= "Adres: ".$_POST[address]."
";
$text .= "Postcode: ".$_POST[zipcode]."
";
$text .= "Plaats: ".$_POST[city]."
";
$text .= "Telefoonnummer: ".$_POST[phone]."
";
$text .= "E-mail: ".$_POST[email]."
";
$text .= "Vraag of opmerking: ".$_POST[comment]."
";
$text .= "";
$mail = new PHPMailer(true);
$body = $text;
$body = preg_replace('/\\\\/','', $body);
$mail->AddReplyTo("info@crommentuyn.nl","Crommentuyn");
$mail->From = "info@crommentuyn.nl";
$mail->FromName = "Crommentuyn";
$to = $_POST[email];
$mail->AddAddress($to);
$to = "info@crommentuyn.nl";
$mail->AddBCC($to);
$mail->Subject = "Contactformulier op de website";
$mail->AltBody = "To view the message, please use an HTML compatible email viewer!";
$mail->WordWrap = 80;
$mail->MsgHTML($body);
$mail->IsHTML(true);
//$mail->Send();
$succes_contact = 1;
}
else
{
$error_contact = 2;
}
}
else
{
$error_contact = 1;
}
}
if ($_GET[pageID]=="2")
{
page_start();
$query_page = mysql_query("select title, text from page where id='$_GET[pageID]'");
$page = mysql_fetch_object($query_page);
?>
$query_worker = mysql_query("select id, name, place, url from worker order by sort");
$worker_count = mysql_num_rows($query_worker);
if ($worker_count=="0")
{
?>
Er zijn momenteel nog geen aannemerss.
}
else
{
?>
| if ($worker->url) { ?> } else { ?> } ?> |