"9") ) return FALSE; return TRUE; } if( $_POST['contactB1'] == "Enquire" ) { $last = ""; $first = ""; $email = ""; $phone = ""; $comment = ""; $subject = $_POST['subject']; } if( $_POST['contactB2'] == "Clear" ) { $last = ""; $first = ""; $email = ""; $phone = ""; $comment = ""; $subject = ""; } if( $_POST['contactB1'] == "Send" ) { $last = $_POST['last_name']; $first = $_POST['first_name']; $email = $_POST['email']; $phone = $_POST['telephone']; $comment = $_POST['comment']; $subject = $_POST['subject']; $msg_str = $err_str = $end_str = ""; if( !strlen($last) || !strlen($first) ) $err_str .= "
  • a contact name is needed
  • \n"; if( strlen($phone)) { if( !phone_check($phone) ) $err_str .= "
  • the phone number must include digits or spaces only
  • \n"; if( strlen($phone) < 6 ) $err_str .= "
  • the phone number must be at least 6 digits
  • \n"; } if( (strlen($email) < 3) || !strstr($email,"@") ) $err_str .= "
  • provide a valid email address
  • \n"; if( strlen($err_str) ) { $msg_str = "

    Oops, we've spotted a mistake in your form:

    \n"; $end_str = "

    Please make corrections and resubmit

    \n"; } else { echo "

    Contact us

    \n"; echo "

    Thank-you for returning the contact information "; if( strlen($comment) ) echo "and the comments"; echo "to us. We will respond to it as soon as we can.

    \n"; echo "

    Please click one of the links on the left to continue browsing.

    \n"; $message = "Website query:\nFirstname: \t$first\nLastname: \t$last\nemail:\t$email\nPhone:\t$phone\nComments:\n$comment\n"; $message .= "Sent at " . date ("l dS of F Y H:i:s") . " " . date("(T)+Z") . "seconds\n"; $SERVER_NAME = "asplen.co.uk"; mail("nick.smeaton@power.net.uk", "Website query:" . $subject, $message, "From: nick.smeaton@power.net.uk\nReply-To: nick.smeaton@power.net.uk\nX-Mailer: PHP/" . phpversion()); $contactB1 = "Done"; } } if( $contactB1 != "Done" ) { echo "

    Contact us

    \n"; if( strlen($msg_str) ) echo $msg_str; if( strlen($err_str) ) echo $err_str; if( strlen($end_str) ) echo $end_str; if( $contactB1 != "Send" ) { echo "

    Asplen Management Ltd

    \n"; echo "
    Tel: +44 (0) 1280 812985
    \n"; echo "
    Fax: +44 (0) 1280 822952
    \n"; echo "email: enquiries@asplen.co.uk\n"; echo "

    Please feel free to contact us using the form below:

    \n"; } echo "
    \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
    Last name:
    First name:
    E-mail address:
    Telephone:
    Subject:
    Message/Comments:

    \n"; echo "    \n"; echo "
    \n"; echo "
    Fill in the form and press send to contact us.
    \n"; } include( "footer.php" ); ?>