好的,最初的建议似乎有效。他们没有像以前那样的错误代码。但现在它告诉我它的结局并不好。我尝试了多种语法,但似乎没有任何效果。和一个 IF 把它拿走......甚至删除<? end if ?>
或诸如此类。有任何想法吗?
<?php
$correct = true;
if ($_GET["firstname"] == "")
$correct = false;
if (preg_match("/^.+@\w+\.\w{2,4}$/", $_GET["email"]))
$correct = false;
$to = "sample@domain.com";
$subject = "Application request";
$message = "A new request has come in!\n\n";
$message .= $_GET["firstname"];
$message .= $_GET["lastname"];"\n";
$message .= $_GET["email"];"\n";
$message .= $_GET["phone"];"\n";
$message .= $_GET["dropdown"];"\n";
$message .= $_GET["address"];"\n";
$message .= $_GET["dropdown2"];"\n";
$message .= $_GET["textarea"];"\n";
?>
<html>
<head>
<title>something funky
</title>
</head>
<body>
<?php if ($correct): ?>
Thank you for applying. We will get back to you shortly.<br>
<?php else: ?>
Please complete the form.
<?php end ?>
</body>
</html>