1

大変な一日で、明らかな何かが欠けていると確信していますが、誰かがこれを一瞥して、空のメールを受け取っている理由を説明してもらえますか? これを可能な限り分解しましたが、空白の理由を見つけることができないようです

<?php
$to = 'blah@blah.com';
$name = $_POST['name'] ;
$subject = "Message from: $name";
$message = $_POST['comment'] ;
$robotest = $_REQUEST['robotest'];
$body = "From: $name \r\nMessage: $message";

/*
if (preg_match($match, $from) ||
preg_match($match, $subject) ||
preg_match($match, $body)) {
die("Header injection detected.");
}
*/

if ($sent == '0') {
mail($to, $subject, $body) or die("Error Bro!!!");
$sent = 1;
}

if ($robotest) {
$error = print("You are a gutless robot.");
}

 if ($name == ' '){
print("You have not entered a name, please go back and try again");
 } else {
$send = mail($to, $subject, $body);
print("Thank you for contacting us. We will be in touch with you very soon.");
 }
 ?>

html:

            <form style="margin-left: 10%;" method="post" action="coming-soon/email.php" enctype="text/plain">
                <br>
                <input id="fName" name="name" type="text"  placeholder="Name (required)"><br><br>
                <p class="robotic" id="pot">
                    <label>If you're human leave this blank:</label>
                    <input name="robotest" type="text" id="robotest" class="robotest" />
                </p>
                <textarea id="fComment" name="comment" style="height: inherit; margin: 0 40% 1% 0;" rows="10" cols="50" placeholder="Place your Message here...."></textarea>
                <input type="submit" value="Send">
                <input type="reset" value="Reset">
            </form>
4

1 に答える 1