// init page defaults:
// -------------------
include("includes/config.inc.php");
include("includes/functions.inc.php");
$PageTitle = SITE_NAME;
$PageHeader = "Neem contact op met " . SITE_NAME;
$SubTitle = "Contact";
$mailOK = false;
$errors = "";
/////////////
//FUNCTIONS:
/////////////
function checkInput($FormData) {
$Input = true;
$name = $FormData['NAME'];
$email = $FormData['Email'];
$onderwerp = $FormData['SUBJECT'];
$message = $FormData['MESSAGE'];
global $errors;
/* test input: */
if (empty($name)) {
$errors .= "Geen naam ingevuld!
\n";
$Input = false;
}
if (empty($email)) {
$errors .= "Geen e-mail adres opgegeven!
\n";
$Input = false;
}
elseif (!isValidEmail($email)) {
$errors .= "Het e-mail adres is ongeldig! Corrigeer het e-mail adres.
\n";
$Input = false;
}
if (empty($onderwerp)) {
$errors .= "Geen onderwerp opgegeven!
\n";
$Input = false;
}
if (empty($message)) {
$errors .= "Geen bericht ingevoerd!
\n";
$Input = false;
}
return $Input;
}
//////////////////
// END FUNCTIONS
//////////////////
//Try to sent the mail
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
if (checkInput($_POST)) {
$mailOK = mailit($NAME, $Email, $SUBJECT, $MESSAGE );
}
else {
$mailOK = false;
}
if (!$mailOK) {
$mailerror = 1; // Used later on to display a warning mail not sent succesfully.
}
}
?>
meezingen.com
|
|
 |
|
 |
|
if ( $_SERVER['REQUEST_METHOD']=='POST' && (!$mailOK || !empty($errors)) ) {
//something went wrong sending the e-mail...
echo " Er is een fout / zijn fouten opgetreden tijdens het versturen van deze e-mail: ";
echo "".$errors." ";
}
elseif ($mailOK) {
echo "E-mail succesvol verstuurd!Bedankt voor je bericht.";
}
?>
|
|
 |
|
 |
|
|