0

1970 年 1 月 1 日の日付から、私のウェブサイトに記入された連絡フォームが突然私の受信トレイに送られてきます???

彼らは私の受信箱の一番下に行き着いていて、私はいくつかのリードを見逃していました...

これが突然起こり始める方法はありますか?

連絡先ページで使用しているコードは次のとおりです: -

<?php
if(isset($_POST['email'])) {

// EDIT THE 2 LINES BELOW AS REQUIRED
$email_to = "my email address";
$email_subject = "Website Contact Enquiry";


function died($error) {
    // your error code can go here
    echo "We are very sorry, but there were error(s) found with the form you submitted.     ";
    echo "These errors appear below.<br /><br />";
    echo $error."<br /><br />";
    echo "Please go back and fix these errors.<br /><br />";
    die();
}

// validation expected data exists
if(!isset($_POST['name']) ||
    !isset($_POST['email']) ||
    !isset($_POST['tel']) ||
    !isset($_POST['message'])||
    !isset($_POST['formtype'])
    ) {
    died('We are sorry, but there appears to be a problem with the form you  submitted.');       
}

$name = $_POST['name']; // required
$email_from = $_POST['email']; // required
$tel = $_POST['tel']; // required
$message = $_POST['message']; // required
$formtype = $_POST['formtype'];


$email_message = "Form details below.\n\n";

function clean_string($string) {
  $bad = array("content-type","bcc:","to:","cc:","href");
  return str_replace($bad,"",$string);
}

$email_message .= "Name: ".clean_string($name)."\n";
$email_message .= "Email: ".clean_string($email_from)."\n";
$email_message .= "Tel: ".clean_string($tel)."\n";
$email_message .= "Message: ".clean_string($message)."\n";
$email_message .= "formtype: ".clean_string($formtype)."\n"; 

// create email headers
$headers = 'From: '.$email_from."\r\n".
'Reply-To: '.$email_from."\r\n" .
'X-Mailer: PHP/' . phpversion().date();
@mail($email_to, $email_subject, $email_message, $headers);  
?>
4

1 に答える 1