Home

Feedback

Your Name:

Your Email:

Reflection:

Comments:

"; // validate email address function check_email_address($email) { // check that there's one @ symbol, and that the lengths are right if (!ereg("^[^@]{1,64}@[^@]{1,255}$", $email)) { // Email invalid because wrong number of characters in one section, or wrong number of @ symbols. return false; } $email_array = explode("@", $email); $local_array = explode(".", $email_array[0]); for ($i = 0; $i < sizeof($local_array); $i++) { if (!ereg("^(([A-Za-z0-9!#$%&'*+/=?^_`{|}~-][A-Za-z0-9!#$%&'*+/=?^_`{|}~\.-]{0,63})|(\"[^(\\|\")]{0,62}\"))$", $local_array[$i])) { return false; } } if (!ereg("^\[?[0-9\.]+\]?$", $email_array[1])) { // Check if domain is IP. If not, it should be valid domain name $domain_array = explode(".", $email_array[1]); if (sizeof($domain_array) < 2) { return false; } for ($i = 0; $i < sizeof($domain_array); $i++) { if (!ereg("^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|([A-Za-z0-9]+))$", $domain_array[$i])) { return false; } } } return true; } if($_POST[op] != "ds") { //show the form echo "$form_block"; } else if($_POST[op] == "ds") { //check value of $_POST[name] if( $_POST[name] == "") { $name_err= "

Please enter your name!


"; $send="no"; } //check value of $_POST[email] if( $_POST[email] == "") { $email_err= "

Please enter your email address!


"; $send="no"; } //check value of $_POST[comments] if( $_POST[comments] == "") { $comments_err= "

Please enter your comments!


"; $send="no"; } if($send != "no") { //build email to kmt $todayis = date("l, F j, Y, g:i a") ; $comments = stripcslashes($comments); $to="kmtrainingltd@yahoo.co.uk"; $headers .= "From: feedback@KMReflections.co.uk\r\n"; $headers .= "Reply-To: $_POST[email]\r\n"; $subject="Feedback from KMReflections.co.uk"; $msg= "$todayis\n\n"; $msg.= "Article writing about: $_POST[article]\n"; $msg.= "Name: $_POST[name]\n"; $msg.= "Email Address: $_POST[email]\n"; $msg.= "Comments: $_POST[comments]\n\n"; $msg.= "IP Address: $ip \n"; //send the mail to kmt mail($to, $subject, $msg, $headers); //display confirmation to user echo "

Thank you for your feedback.

Your message was sent to Kieran Mullin.

Thank you very much for your feedback!

"; //buiild email to user $to2="$_POST[email]"; $headers2 = "From: kmtrainingltd@yahoo.co.uk\r\n"; $subject2="Thank you for contacting KieranMullin.co.uk"; $msg2= "$todayis\n\n"; $msg2.= "Thank you for contacting Kieran Mulliin at www.kmreflections.co.uk.\n\n"; $msg2.= "Thank you very much for your feedback!\n\n"; $msg2.= "Best Regards,\n"; $msg2.= "Kieran Mullin"; //send the mail to user mail($to2, $subject2, $msg2, $headers2); } else if ($send == "no") { //print error commentss echo "$name_err"; echo "$email_err"; echo "$comments_err"; echo "$form_block"; } //else } ?>