以下是我正在尝试做的简化版本。基本上我有 2 个注册表,每个表单的内容将写入不同的表。当我加载表单时,我在第 xx 行收到许多未定义索引错误,并且我仍然在第 75 行和第 84 行的这个示例中收到错误,我认为错误归因于某些字段是“必需的”,但该页面尚未加载为它使用一些 JS 飘走了。... 请帮忙!
<?php
ob_start(); //Turns on output buffering
session_start(); //This starts a session variable where it store the input so the user doesnt have to start over if they get an error
$con = mysqli_connect("localhost","root","","test-sql"); //connection variables
$timezone = date_default_timezone_set("Europe/London");
if(mysqli_connect_errno()){
echo "failed to connect:" . mysqli_connect_errno();
}
?>
<html>
<head>
<! here we add the links and the jquery>
<title>Register Project</title>
</head>
<body>
<div id="first">
<form action="test-sql.php" method="POST">
<input type="text" name="Inf_fname" placeholder="First Name" required>
<br>
<input type="text" name="Inf_lname" placeholder="Last Name" required>
</form>
</div>
<div id="second">
<form action="test-sql.php" method="POST">
<br>
<input type="text" name="Cust_fname" placeholder="First Name" required>
<br>
<input type="text" name="Cust_lname" placeholder="Last Name" required>
<br>
<input type="submit" name="register_button" value="Register">
</form>
</div>
</body>
</html>
HUWWW
相关分类