'; $message = ''; $technewproject = false; $techexistingproject = false; $techdatabase = false; $techstaticwebsite = false; $techdynamicwebsite = false; $techwinapp = false; if (isset($_POST['submit'])) { $sent = ProcessBespoke(); if ($sent) { $ip = $_SERVER['REMOTE_ADDR']; $hostname = gethostbyaddr($ip); // send to website admin SendEmail( $from, 'New Website Message', "A visitor on your website has sent you a message:\n\n" . "\tName: {$name}\n\tIP: {$ip} ({$hostname})\n\tE-Mail: {$email}\n\tMessage: \n$message\n" ); $usermessage = 'Your message was sent. Thank you!'; } } function GetFromPost($name) { if (isset($_POST[$name])) { $result = htmlentities(trim($_POST[$name])); } else { $result = ''; } //echo "

{$name}='{$result}'

"; return $result; } function IsBlank($value) { return $value == ''; } function AddToUserMessage($msg) { global $usermessage; if ($usermessage != '') $usermessage .= "
\n"; $usermessage .= $msg; } function CheckRequiredField($value, $msg) { global $usermessage; if (IsBlank($value)) { AddToUserMessage($msg); } return $value; } function IsValidEmail($email) { return (preg_match("/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/", $email)); } function ProcessBespoke() { global $usermessage, $sent; global $name, $telephone, $organisation, $email, $message; global $technewproject, $techexistingproject, $techdatabase, $techstaticwebsite; global $techdynamicwebsite, $techwinapp; $name = CheckRequiredField(GetFromPost('name'), 'Your name is missing.'); $telephone = GetFromPost('telephone'); $organisation = GetFromPost('organisation'); $email = CheckRequiredField(GetFromPost('email'), 'Your e-mail address is required.'); if (!IsValidEmail($email)) { AddToUserMessage('Please check your e-mail address.'); } // get the project type checks $technewproject = GetFromPost('technewproject') != ''; $techexistingproject = GetFromPost('techexistingproject') != ''; $techdatabase = GetFromPost('techdatabase') != ''; $techstaticwebsite = GetFromPost('techstaticwebsite') != ''; $techdynamicwebsite = GetFromPost('techdynamicwebsite') != ''; $techwinapp = GetFromPost('techwinapp') != ''; $message = CheckRequiredField(GetFromPost('message'), 'The message was empty. Please include a description of your project.'); $projecttype = GetCheckedValue($technewproject, 'Is new project') . GetCheckedValue($techexistingproject, 'Is existing project') . GetCheckedValue($techdatabase, 'Uses a database') . GetCheckedValue($techstaticwebsite, 'Is static website') . GetCheckedValue($techdynamicwebsite, 'Is dynamic website') . GetCheckedValue($techwinapp, 'Is windows-based application'); /* if ($email == '') { $visitoremail = ''; } else { if ($name != '') { $visitoremail = "{$name} <{$email}>"; } else { $visitoremail = $email; } } */ if ($usermessage == '') { // if email address is given try sending a confirmation to test if ok // if not ok (not sent) don't bother sending to recipient (us) if ($email != '') { //send to customer (confirmation) $sent = SendEmail( $email, 'Whitedream Software autoreply message', "Thank you for requesting a quote from Whitedream Software\n\n" . "This is a confirmation informing you that your request has been sent.\n\n" . "Your message as follows:\n" . "\tYour name: {$name}\n\tProject features:\n{$projecttype}\n\tMessage: \n{$message}\n\n" ); } else { $sent = true; } } return $sent; } function GetCheckedValue($checkvalue, $msg) { if ($checkvalue) { return "\t{$msg}\n"; } else { return ''; } } function SendEmail($to, $subject, $message) { global $from; $headers = "From: {$from}"; return mail($to, $subject, wordwrap($message, 70), $headers); //echo "

email to {$to}

\n"; //return true; } function AddTextBox($class, $id, $size, $maxlength, $value) { $decodedvalue = html_entity_decode($value); echo '' . "\n"; } function AddCheckBox($id, $title, $value, $checked) { if ($checked) $checkvalue = ' checked=checked'; else $checkvalue = ''; echo '\n"; } function AddMemo($class, $id, $cols, $rows, $value) { $decodedvalue = nl2br(html_entity_decode($value)); echo '\n"; } ?> Whitedream Software - Contact Us

ask us for a quote


If you wish for a free quote please fill-in the details below. We will contact you with a price guide and how long it will take. Please remember to add your name and e-mail address.

If you wish to send us a comment or query please click here instead.

user message={$usermessage}

\n"; if ($usermessage != '') { echo '

' . $usermessage . '

' . "\n"; } ?>

(and best time to contact)

(please be as detailed as possible)

Thank you for your message. We will not use any of your details to contact you with sales, calls or spam. Please view our privacy policy for a full explaination.