if( !empty( $_POST ) )
{
$body = $_POST["body"];
$subject = $_POST["subject"];
$email = $_POST["email"];
$player = $_POST["player"];
if( !empty( $body ) )
{
if( empty( $subject ) || empty( $email ) )
{
echo "You need to supply a valid subject and email address
";
}
else
{
// check reCAPTCHA information
require_once('recaptchalib.php');
$privatekey = "6Ld2hsASAAAAAAhNJ02T8jtSeyPV2KVMpbQoJ-hZ";
$resp = recaptcha_check_answer (
$privatekey
, $_SERVER["REMOTE_ADDR"]
, $_POST["recaptcha_challenge_field"]
,$_POST["recaptcha_response_field"]);
if ($resp->is_valid)
{
echo "Thank you. An email has been sent to Grey.
";
$subject = stripslashes( $subject );
$body = stripslashes( $body );
$player = stripslashes( $player );
mail("dshay01@yahoo.com","[WebForm] $subject from $player","$body -- from $email");
}
else
{
echo "Invalid response to CAPTCHA. Could not send email.
";
}
}
}
}
?>
|