Ich bin ein Anfänger mit PHP und ich versuche mein Kontaktformular auf localhost zu testen. Wenn ich auf "submit" klicke, erhalte ich folgenden Hinweis: "Hinweis: Undefinierte Variable: POST in C: \ wamp64 \ www \ form \ terminationform.php in Zeile 5" Ich sah einen Vorschlag, $ _POST anstelle von $ POST zu verwenden. Aber das ist es, was ich tue, daher kann ich das Problem hier nicht herausfinden.Warum bekomme ich "Undefinierte Variable: POST" in C: wamp64 www form terminationform.php hier?
Hier ist mein HTML-Code:
<!doctype html>
<form action="appointmentform.php" method="POST">
<select name="dropdown" class="float-left">
<option value="option">Select a Service</option>
<option value="Facial">Facial</option>
<option value="Threading">Threading</option>
</select>
<input class="float-right" placeholder = "mm/dd/yy" aria-invalid="false" type="date" name="date">
<input class="right" placeholder = "Time" aria-invalid="false" type="time" name="time">
<p class="sub-tit">Personal Information</p>
<input class="float-left" placeholder="Full Name" type="text" name="name">
<input class="float-left" placeholder="Phone" type="text" name="phone">
<input type="text" placeholder="Email" name="email">
<input type="submit" class="qbuuton float-right" value="Submit">
</form>
Und hier ist mein PHP-Code:
<?php
$name = $_POST['name'];
$phone = $_POST['phone'];
$email = $_POST['email'];
$dropdown = $POST['dropdown'];
$date = $_POST['date'];
$time = $_POST['time'];
$formcontent="From: $name \n Phone: $phone \n Email: $email \n Service: $dropdown \n Date: $date \n Time: $time";
$recipient = "[email protected]";
$subject = "Customer Appointment Request";
$mailheader = "From: $email \r\n";
mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
echo "Thank You!";
?>
'$ Post' sein! ==' $ _POST' –