为什么当我点击它刚刚在数据库中输入的第一个数据的提交按钮时,它不在页面视图中。之后,一旦在页面中输入数据,再次单击,但是当我检查数据库时,数据是两个相同的。怎么样。
<?php
include 'xx.php';
?>
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<form method="post" >
<center>
<div>
<tr>
<td>
<label><b>User</b></label>
<input type="user" placeholder="User" name="user" required>
</td>
</tr>
</div>
<div>
<tr>
<td>
<label><b>Position</b></label>
<input type="position" placeholder="Position" name="position" required>
</td>
</tr>
</div>
<div>
<tr>
<td>
<label><b>Serial Number</b></label>
<input type="serial" placeholder="Serial Number" name="serialnumber" required>
</td>
</tr>
</div>
<div>
<td>
<center>
<input type="submit" name="send" value="Submit"></input></center>
</center>
</td>
</div>
</body>
</html>
<?php
if (isset($_POST['send'])) {
$user=$_POST['user'];
$position=$_POST['position'];
$serialnumber=$_POST['serialnumber'];
$xx="INSERT INTO xx (user,position,serialnumber)VALUES('$user','$position','$serialnumber')";
$result=mysqli_query($dbconfig,$sql);
echo "<script language='javascript'>window.location.href='xx.php'</script>";
}
?>