It works properly when the form is filled out, but it also sends out hundreds blank emails random times. I don't know where the problem might be. It only send blank emails. Please help me to fix it! Thank you
Here's the PHP code:
$emailSubject = "6 Months Performance Evaluation for ".$_POST['name'];
$weBMaster = '#';
$employeeName = $_POST['name'];
$designationName = $_POST['designation'];
$accountDept = $_POST['account'];
$dateHired = $_POST['datehired'];
$datePeriod = $_POST['dateperiod'];
$evalname = $_POST['nameevaluator'];
$evalDesignation = $_POST['evaluatordesignation'];
$job_knowledge = $_POST['job_knowledge'];
$job_knowledge_comment = $_POST['job_knowledge_comment'];
$body = <<<EOD
<h2>6 Months Performance Evaluation for $employeeName $datePeriod </h2><br><hr><br>
<h3>Employee Data</h3>
Name: $employeeName<br>
Designation: $designationName<br>
Account/Dept: $accountDept<br>
Date Hired: $dateHired<br>
For the Period of: $datePeriod <br>
<h3>Evaluator</h3>
Evaluator: $evalname<br>
Designation: $evalDesignation<br>
<h3>Ratings</h3>
1. Job Knowledge: $job_knowledge <br>
Measures employee's demonstrated job relevant knowledge and essential skills, such as work practices, policies, procedures, resources, laws, customer service, and technical information, as well as the relationship of work to the organization's mission. <br>
Comment: $job_knowledge_comment <br><br>
EOD;
$headers = "From: #\r\n";
$headers .= "Content-type: text/html\r\n";
$success = mail($weBMaster,$emailSubject, $body, $headers);
$theresults = <<<EOD
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Evaluation Form</title>
</head>
<body>
<meta http-equiv="refresh" content="0; url=#" />
</body>
</html>
EOD;
echo "$theresults";
?>