Esempio n. 1
0
        // check if subject only contains letters and whitespace
        if (!preg_match("/^[a-zA-Z ]*\$/", $subject)) {
            $subjectErr = "Only letters and white space allowed";
        }
    }
    if (empty($_POST["message"])) {
        $message = "";
    } else {
        $message = test_input($_POST["message"]);
    }
    // Added this section
    if ($captchaErr != "") {
        echo "<span class=\"form-error\">{$captchaErr}</span><br>";
    }
    if ($emailErr == "" && $captchaErr == "") {
        makeMessage($_POST["name"], $_POST["subject"], $_POST["email"], $_POST["message"]) . "</span>";
        echo "<span class=\"form-happy\">Message made! and sent!</span>";
    } else {
        echo "<span class=\"form-error\">Can't send e-mail!</span><br>";
        echo "<span class=\"form-error\">{$emailErr}</span>";
    }
}
function test_input($data)
{
    $data = trim($data);
    $data = stripslashes($data);
    $data = htmlspecialchars($data);
    return $data;
}
function spamcheck($field)
{
Esempio n. 2
0
 public static function SendPaymentFailureMessage($puserid, $message)
 {
     $msgToUser = "";
     $message = makeMessage($message);
     if (mail($puserid, "There was a transaction failure.", $message, Def_headers)) {
         $msgToUser = "******";
     } else {
         $msgToUser = "******";
     }
     return $msgToUser;
 }