这是 php 代码,下面是 HTML 文件。我不断收到未识别的索引错误,我不知道为什么。请帮忙!
$firstname = $_POST["fname"];
$lastname = $_POST['lname'];
$sql = "INSERT INTO user(fname,lname)
VALUES ('$firstname','$lastname')";
<form action="connect.php" method="post">
First name: <input type="password" name="fname">
Last name: <input type="text" name="lname"><br><br>
<input type="submit" value="Sign up!" id="btnsignup" />
</form>