Looks like send.php is being accessed and sending blank emails. Need to make it so send.php doesn't send email, unless the submit button is used on a form. I was told 'isset $_post' would help me, just not clear on how to execute it.
Here's send.php code:
<?php
$recipient = 'test@test.com';
$email = $_REQUEST['Email'];
$subject = 'Contact Form Submission';
$content = "The following has been submitted on your website
";
$redirect = 'thankyoupage.html';
$user = $_REQUEST['Email'];
$usersubject = "Subject";
$userheaders = "From: test@test.com
";
$usermessage = "Blah blah blah";
mail($to,$subject,$message,$headers);
mail($user,$usersubject,$usermessage,$userheaders);
foreach($_POST as $k=>$v)
{
$content .= "$k: $v
";
}
mail_it(stripslashes($content), $subject, $email, $recipient);
if (isset($_POST['redirect']))
{
header("Location:".$_POST['redirect']);
}
else
{
header("Location: $redirect");
}
function mail_it($content, $subject, $email, $recipient)
{
$headers .= "From: ".$email."
";
$headers .= "Reply-To: ".$email."
";
if ($bcc) $headers .= "Bcc: ".$bcc."
";
$headers .= "X-Priority: 0
";
$headers .= "X-Mailer: bjm Formmail
";
$message = $content."
";
if( !mail($recipient, $subject, $message, $headers))
{
echo "Sorry - an error occured trying to send the mail";
}
}
?>