$value) { // assign to temporary variable and strip whitespace if not an array $temp = is_array($value) ? $value : trim($value); // if empty and required, add to $missing array if (empty($temp) && in_array($key, $required)) { array_push($missing, $key); } // otherwise, assign to a variable of the same name as $key elseif (in_array($key, $expected)) { ${$key} = $temp; } } } // validate the email address if (!empty($email)) { // regex to identify illegal characters in email address $checkEmail = '/^[^@]+@[^\s\r\n\'";,@%]+$/'; // reject the email address if it deosn't match if (!preg_match($checkEmail, $email)) { $suspect = true; $mailSent = false; unset($missing); } } // go ahead only if not suspsect and all required fields OK if (!$suspect && empty($missing)) { // set default values for variables that might not exist $interests = isset($interests) ? $interests : array('None selected'); $views = isset($views) ? $views : array('None selected'); // build the message $message = "Name: $name\n\n"; $message .= "Email: $email\n\n"; $message .= "Inquiry Message: $comments\n\n"; $message .= "Message For: $visited\n\n"; // limit line length to 2000 characters $message = wordwrap($message, 2000); // create additional headers $headers = 'From: BasicX'; if (!empty($email)) { $headers .= "\r\nReply-To: $email"; } // send it $mailSent = mail($to, $subject, $message, $headers); if ($mailSent) { // $missing is no longer needed if the email is sent, so unset it unset($missing); } } } ?> BasicX Contact
BasicX
 
BasicX CONTACT

Please complete the missing item(s) indicated.

Sorry, there was a problem sending your message. Please try later.

Your message has been sent. Thank you for contacting us.

Please use this form to contact BasicX Sales & Support. Please complete all fields.

Your details

/>

/>

Inquiry

NetMedia Inc., 10956 N Stallard Place, Tucson Arizona 85737