所以我是PHP新手。我目前正在学校上网页设计课程,但遇到了问题。每当我点击“提交”按钮时,都会出现错误。我需要代码要做的就是在提交时显示一条消息。任何帮助都会很棒。再次感谢
html
<form action="contact.php" method="post">
<label>First Name:</label>
<input type="text" name="fname" id="fname"><br><br>
<label>Last Name:</label>
<input type="text" name="lname" id="lname"><br><br>
<label>Phone No:</label>
<input type="text" name="phone" id="phone"><br><br>
<label>Address:</label>
<textarea name="address" rows="5"></textarea><br><br>
<label>Number of people:</label>
<input type="number" name="people" id="people"><br><br>
<input type="submit">
PHP
<?php
$fname = $_POST["fname"];
$lname = $_POST["lname"];
$phone = $_POST["phone"];
$add = $_POST["address"];
$people = $_POST["people"];
echo "<b>Entered Information is</b><br>";
echo "First Name:".$fname."<br>";
echo "Last Name:".$lname."<br>";
echo "Phone Number:".$phone."<br>";
echo "Address:".$add."<br>";
echo "No.of People:".$people."<br>";
?>