Forum Moderators: coopster
<?php
include 'config.php';
error_reporting (E_ALL ^ E_NOTICE);
$post = (!empty($_POST)) ? true : false;
if($post)
{
include 'functions.php';
$name = stripslashes($_POST['name']);
$email = trim($_POST['email']);
$address = stripslashes($_POST['address']);
$contact = stripslashes($_POST['contact']);
$design = stripslashes($_POST['design']);
$colour = stripslashes($_POST['colour']);
$error = '';
// Check name
if(!$name)
{
$error .= 'I think you forget to enter your name.<br />';
}
// Check email
if(!$email)
{
$error .= 'I think you forget to enter your e-mail id.<br />';
}
// Check feedback msg
if(!$address)
{
$error .= 'I think you forget to enter your address.<br />';
}
if(!$contact)
{
$error .= 'I think you forget to enter your Contact number.<br />';
}
if(!$design)
{
$error .= 'I think you forget to select the Design.<br />';
}
if(!$colour)
{
$error .= 'I think you forget to select the colour.<br />';
}
if($email && !ValidateEmail($email))
{
$error .= 'Invalid E-mail id !<br />';
}
if(!$error)
{
$mail = mail(WEBMASTER_EMAIL, $subject, $address, $contact, $design, $colour,
"From: ".$name." <".$email.">\r\n"
."Reply-To: ".$email."\r\n"
."X-Mailer: PHP/" . phpversion());
if($mail)
{
echo 'OK';
}
}
else
{
echo '<div class="notification_error">'.$error.'</div>';
}
}
?>