"; else echo "
"; } function check_email_address($string) { if($string){ if(!filter_var($string, FILTER_VALIDATE_EMAIL)) return 2; // Invalid Email return 0; // Valid email } return 1; } /* // Look for invalid characters if(strspn(strtolower($string),"abcdefghijklmnopqrstuvwxyz0123456789-_@.") < strlen($string)) return 2; // Check for .. url's if(strstr($string,"..")) return 3; // Check to make sure that the address is in the xxxx.xxx@xxx.xxx format // Get left and right side of the URL $left=strtok($string, "@"); // Get right side $right=strtok("@"); // See if the url is x@x@x if(strtok("@")) return 4; // Check for valid domain name // First chacter can't be a "." if(strspn(substr($right,0,1),".")) return 5; // Last 2 characters can't be a "." if(strspn(substr($right,-2),".")) return 6; // Must have a dot in the URL if(! strpos($right,".")) return 7; // Check name // Must be at least one character long if(! $left) return 8; // First character can't be a "." if(strspn(substr($left,0,1),".")) return 9; // Last character can't be a "." if(strspn(substr($left,-1),".")) return 10; return 0; } // Null string else return 1; } */ function check_name($string) { if($string){ // Look for invalid characters if(strspn(strtolower($string),"abcdefghijklmnopqrstuvwxyz0123456789-_@ .") < strlen($string)) return 2; return 0; } else return 1; } /* ////////////////////////////////////// /// Recaptca Function /// ////////////////////////////////////// require("$root//php/recaptchalib.php"); $pass="woofagator"; require("$root/php/key_box.php"); # the response from reCAPTCHA $resp = null; # the error code from reCAPTCHA, if any $error = null; if (isset($_POST["recaptcha_response_field"])) { $resp = recaptcha_check_answer ($privatekey,$_SERVER["REMOTE_ADDR"],$_POST["recaptcha_challenge_field"],$_POST["recaptcha_response_field"]); if ($resp->is_valid) { $resp="email-ok-to-send"; } else { $resp=""; } } */ ////////////////////////////////////// /// Send an E-Mail Function /// ////////////////////////////////////// // Check to see if the cancel button was pressed if(isset($_POST['cancel'])){ header("Location: /index.html"); } // Title for the page $page_title="Photography by Jim Christensen: Contact page"; require("$root/php/header.php"); ?>
Name Required
"; if($error > 1) $sender_name_error = "Name has invalid characters
"; // Check senders email address $error=check_email_address($sender_email); if($error == 1) $sender_email_error = "E-Mail Address Required
"; if($error > 1) $sender_email_error = "Invalid E-Mail Address
"; // Check subject text // $error=check_message($sender_subject); if (! $sender_subject) $sender_subject_error = "Please enter a subject
"; } if($sender_name_error.$sender_email_error.$sender_subject_error.$message_error=="" && /*$resp=="email-ok-to-send" &&*/ $submit) { ///////////////////////// // Build the message // ///////////////////////// // Fix new lines in message $message=nl2br($message); $from = << EOT; // mail("jimc@uwphoto.net","Uwphoto.net E-Mail: ".$sender_subject,/*$head."".$body.$data.""*/$message,$from); ////////////////////////////////// // Put "Sent message" on screen // ////////////////////////////////// // Cleanup the submit so it will work again $submit="clear_form"; ?>

Thank you for your comments.


Tell us what you think! Please complete the following fields.
Your Name:
Your E-Mail Address:
Subject:
Your message:



       

We will only use your email to reply to this message.