Firefox没有$ _POST所有重复的区域值,它只发布最后一个

So the code posted below work fine in Internet Explorer but not in Firefox. When passing the URL variable UserName Firefox only uses the last record in the record-set regardless of which button is chosen. This page uses a repeating region in order to allow a site administrator to set passwords, update user profiles, and delete users by clicking on individual buttons within each region. What should happen is that when a button is clicked it should forward you to the corresponding page with that regions UserName value included on the end of the URL. The issue is within Firefox only. $_POST['UserName'] always equals the value of the last created record in the SQL database. I am pretty new to PHP so I am not sure what I am overlooking here. None of my searches have been any help.

Here is the PHP:

<?php
$query_ManageUsers =$dbh->prepare("SELECT * FROM users WHERE UserLevel = 0 ORDER BY UserName ASC");
$query_ManageUsers->execute();
$row_ManageUsers = $query_ManageUsers->fetch(PDO::FETCH_ASSOC);
$query_RowCount = $dbh->prepare("SELECT COUNT(*) FROM users");
$totalRows_ManageUsers = $query_RowCount->fetchColumn();

if ((isset($_POST['UserID'])) && ($_POST['UserID'] != ""))
{
    $userName = $_POST['UserName'];
    switch ($_REQUEST['admin'])
    {
        case "Reset Password":
            $redirect = "SetPassword.php?UserName=$userName";
            header(sprintf("Location: %s", $redirect));break;
        case "Update Profile":
            $redirect = "UpdateUserProfile.php?UserName=$userName";
            header(sprintf("Location: %s", $redirect));break;
        case "Delete User":
            $redirect = "ConfirmDelete.php?UserName=$userName";
            header(sprintf("Location: %s", $redirect));break;
    }
}
?>

And here is the HTML

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EDGE"/>
<meta http-equiv="Content-Type" content="text/html: charset=utf-8"/>
<title>Admin</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<script language="JavaScript" type="text/javascript">document.documentElement.className="xr_bgh2";</script>
<link rel="stylesheet" type="text/css" href="index_htm_files/xr_main.css"/>
<link rel="stylesheet" type="text/css" href="index_htm_files/xr_text.css"/>
<link rel="stylesheet" type="text/css" href="index_htm_files/custom_styles.css"/>
<script type="text/javascript" src="index_htm_files/roe.js"></script>
</head>
<body class="xr_bgb2">
<div style="width:625px;">
<label style="text-align:left; font-size:18px; font-weight:bold;" >User Administration</label>
<?php if ($row_ManageUsers != 'null') { // Show if recordset not empty ?>
<?php do { ?>
<table border="1">
    <tr>
    <td>
    <form id="ManageUsers" method="post" >
        <table width="615">
        <tr>
        <td style="width:250px">
        <input name="UserName" style="width:250px; background-color:#C8DACA; border:none; font-size:14px" id="UserName" value="<?php echo $row_ManageUsers['UserName']; ?>" readonly="readonly" /></td>
         <td style="width:100px">
         <input name="admin" type="submit" value="Reset Password" form="ManageUsers" /></td>
         <td style="width:100px">
         <input name="admin" type="submit" value="Update Profile" form="ManageUsers" /></td>
         <td style="width:100px">
         <input name="UserID" type="hidden" id="UserID" form="ManageUsers" value="<?php echo $row_ManageUsers['UserID']; ?>" />
         <input name="admin" type="submit" value="Delete User" form="ManageUsers"/>
         </td>
         </tr>
     </table>
  </form>
</td>
</tr>
</table>
<?php } while ($row_ManageUsers = $query_ManageUsers->fetch(PDO::FETCH_ASSOC)); ?>
<?php } // Show if recordset not empty ?>
</div>
</body>
</html>

As I mentioned in the comments the issue is that your form(s) have the same ID, if you look at your html/php code you will notice that the whole form is output for each loop, and that includes the same id for each iteration of the loop.

Some browsers will ignore this others may just use the last occurrence of the ID.

Without testing this I cant be 100% sure that is the issue, but it's bad practice at the least and should be fixed.

I would suggest using a unique id or even using that id as a class instead.

Just to clarify, when I said form id I mean this

 <form id="ManageUsers" method="post" >