Php 我使用$\u POST,得到的是空值

Php 我使用$\u POST,得到的是空值,php,mysql,post,Php,Mysql,Post,看起来元素在呈现任何元素之前正在关闭表单。您可以发布用于将post操作提交到PHP文件的代码吗?^这太简单了。我们需要一个挑战@joncloudI,我的钱在输入上没有被视为数组和/或没有名称属性,表单中没有post方法。但是,这是猜测,就像未知的形式。和我的5分钟。注意力刚用完。祝你好运。神奇的答案只在万圣节才会出现,而我们离10月31日还远着呢,是吗?非常感谢!!:) <html> <head> </head> <body> <form a

看起来
元素在呈现任何
元素之前正在关闭表单。

您可以发布用于将post操作提交到PHP文件的代码吗?^这太简单了。我们需要一个挑战@joncloudI,我的钱在输入上没有被视为数组和/或没有名称属性,表单中没有post方法。但是,这是猜测,就像未知的形式。和我的5分钟。注意力刚用完。祝你好运。神奇的答案只在万圣节才会出现,而我们离10月31日还远着呢,是吗?非常感谢!!:)
<html>
<head>
</head>
<body>
<form action="" method="POST">
<input type="submit" name="submit">
</form>
<?php
$servername = "localhost";
$username = "username";
$password = "password";
$dbname = "db";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
} 
$sql = "SELECT * FROM Pelates";
$result = $conn->query($sql);
$count=$result->num_rows;  
if ($result->num_rows > 0) {
echo "<table><tr><th></th><th>Name</th><th>Surname</th></tr>";
// output data of each row
while($row = $result->fetch_assoc()) {
    echo "<tr><td><input type='hidden' id='num' name='number[]' value='".$row["number"]."'/></td><td><input type='text' id='nam' name='name[]' value='".$row["name"]."'/></td><td><input type='text' id='surnam' name='surname[]' value='".$row["surname"]."'/></td></tr>";
}
echo "</table>";
} else {
echo "0 results";
}
if(isset($_POST['submit'])){
    $name = $_POST['name'];
    $surname = $_POST['surname'];
    $number = $_POST['number'];
for($i=1;$i<=$count;$i++){
$sql = "UPDATE Pelates SET name='".$name[$i]."', surname='".$surname[$i]."' WHERE number=".intval($number[$i])."";
if (mysqli_query($conn, $sql)) {
echo "Update ok";
} else {
echo "Error updating record: " . mysqli_error($conn);
}
}
mysqli_close($conn);
}
?>
</body>
</html>