为什么我的$ Post动作不起作用

Geo*_*ams 2 html php forms post

在我的代码中,我有2个表单,其中包含2个操作(一个用于更改密码详细信息,另一个用于更改客户名称).单击该按钮时,表单将数据提交到处理SQL语句的UpdateCustomer.php页面.

    <ul>
      //this form action works
        <form action="Functions/Customer/UpdateCustomer.php" form name="CustomerDetails" method="post">
        <li><label for="Name">Name</label>
        <input type="text" name="updateName" value="<?php echo $row_Customers['Customer_Name'] ?>" style='width:300px;'/><button>Update</button></li>   
        </form> 

        <br />

      //this form action doesn't
        <form action="Functions/Customer/UpdateCustomer.php" form name="ChangePassword" onSubmit="return validateForm()" method="post">
         <div class="pass" ><label for="password">Password</label>
        <input type="password" name="updatePassword" id="updatePassword" value="" style='width:300px;'/></div>
        <div class="pass" ><label for="confirmPassword">Confirm Password</label>
        <input type="password" name="confirmPassword" value="" style='width:300px;'/><button>Change Password</button></div>
        </form> 
    </ul>
Run Code Online (Sandbox Code Playgroud)

然后我的UpdateCustomer.php检索这些变量:

$Name = $_POST['updateName'];
$Password = $POST['updatePassword'];
Run Code Online (Sandbox Code Playgroud)

如果我提交了CustomerDetails表单,当我在$ Name上进行回显时,它会显示输入的名称,但是当我在提交ChangePassword表单后对$ Password进行回显时,我没有得到任何价值.

任何帮助深表感谢!

谢谢

kol*_*nar 7

您有语法错误,更改

$Password = $POST['updatePassword'];
Run Code Online (Sandbox Code Playgroud)

$Password = $_POST['updatePassword'];
Run Code Online (Sandbox Code Playgroud)