I am adding a page to my site that allows doctors to send me referrals. Some of the data will be highly sensitive, so I need to be sure that it is handled as securely as possible. The data doesn't get stored in a database. It is simply emailed directly to me. The PHP script is below.
I use the str_replace function to filter out URLs. I'm not too concerned about that. I really, though, need to be sure that bad guys cannot intercept what's being sent. The lawsuit may be a little more than ugly. How does it look? Does anyone think I need to add or remove anything to keep the bad guys at bay? I plan on adding a Captcha before I publish the page. Thanks in advance.
if(isset($_POST['submit'])) {
$domains = array('.com', '.org', '.net', '.gov', '.edu', '.mil', '.int');
$replacement = array('/*com*', '/*org*', '/*net*', '/*gov*', '/*edu*', '/*mil*', '/*int*');
$to = "email@place.com";
$subject = "**** (Referral)";
$physican_field = strip_tags($_POST['physician']);
$name_field = strip_tags($_POST['patient']);
$insurance_field = strip_tags($_POST['primary']);
$insurancenumber_field = strip_tags($_POST['insurance#']);
$phone_field = strip_tags($_POST['phone']);
$address = strip_tags($_POST['address']);
$address = str_replace($domains, $replacement, $address);
$body = "Physician: $physican_field\n Patient: $name_field\n Phone: $phone_field\n Primary Insurance: $insurance_field\n Insurance/Medicare#: $insurancenumber_field\n File: $file_uploaded\n Address: $message\n";
mail($to, $subject, $body);
} else {
die("We apologize, but your form was not submitted succesfully");
}