Contact the studio
$showform = true; $errors = array(); if($_POST['submit']){ if($_POST['name'] == "" || $_POST['name'] == "Your Name") $errors[] = "Please enter your name"; if (!ereg('^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+'. '@'. '[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.'. '[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$', $_POST['email']) || $_POST['email']=="") $errors[] = "Please enter a valid email address"; if($_POST['message'] == "") $errors[] = "Please enter your question or comment"; if($_POST['spam-blocker'] != "7") $errors[] = "Please confirm that you are human by answering the simple equation at the end of the form"; if(count($errors) < 1) { $showform = false; } } if ($showform == true) { //Check to see if the errors array is populated if(count($errors)) { print "- ";
foreach($errors as $key => $val) {
print "
- $val "; } print "
I have a message from a visitor to the west wing recording website.
Name: $name
Email: $email
Phone: $phone
Message:
$message
---------------
End of message"; $mail->setHtml($html, $text); $mail->setFrom($name . '<' . $email . '>'); $mail->setSubject('Message from visitor to west wing recording website'); $result = $mail->send(array("trevor@westwingrecording.com"), 'smtp'); // These errors are only set if you're using SMTP to send the message if (!$result) { echo "
Error sending message. Please try again.
"; } else { echo 'Message sent!
'; } } ?>