Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在php的一个页面中存在多个表单的问题_Php_Html_Mysql - Fatal编程技术网

在php的一个页面中存在多个表单的问题

在php的一个页面中存在多个表单的问题,php,html,mysql,Php,Html,Mysql,我的问题是,我创建了两个表单,它是一个配置文件页面,一个用于将用户图像上载到数据库,另一个用于更新用户基本信息,如姓名、电子邮件等。我的问题是,只有一个表单在工作,另一个表单停止工作。这是我的密码。 <?php if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "pic_form") &&(($_POST['check'])=== 1)) { $id=$_POST['monit

我的问题是,我创建了两个表单,它是一个配置文件页面,一个用于将用户图像上载到数据库,另一个用于更新用户基本信息,如姓名、电子邮件等。我的问题是,只有一个表单在工作,另一个表单停止工作。这是我的密码。

 <?php if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] ==     "pic_form") &&(($_POST['check'])=== 1)) {
$id=$_POST['monitorimg'];
move_uploaded_file($_FILES['pic']['tmp_name'],"imageupload/".$id);
   $updateSQL = sprintf("UPDATE administrator SET pix=%s WHERE adminid=%s",
                  GetSQLValueString($_POST['monitorimg'], "text"),
                   GetSQLValueString($_POST['ids'], "int"));

    mysqli_select_db($myconn,$database_myconn);
   $Result1 = mysqli_query($myconn,$updateSQL) or    die(mysqli_connect_error());
} 
  ?>      


    <div class="box box-primary">
                    <div class="box-body box-profile">


           <img class="profile-user-img img-responsive img-circle"    width="68" height="68" src="imageupload/<?php echo $row_rslinks['adminid']; ?>".""                     alt="profile picture">
              <form action="<?php echo $editFormAction; ?>" name="pic_form" enctype="multipart/form-data" method="POST">
                   <input type="file" name="pic" class="btn-facebook" required>
                   <input type="submit" class="btn-dropbox" name="sub" id="sub" value="Upload">
                   <input type="hidden" name="ids" id="ids" value="<?php echo $row_rslinks['adminid'];?>">
                   <input type="hidden" name="monitorimg" id="monitorimg" value="<?php echo $row_rslinks['adminid'];?>">
                   <input type="hidden" name="MM_update" value="pic_form">
                  <input type="hidden" name="check" id="check" value="1">
              </form>

                        <h3 class="profile-username text-center"></h3>

                        <p class="text-muted text-center"></p>


  <!-----------This is the second Table code--------------> 


 <?php  if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1") &&(($_POST['check'])=== 1)) {
  $updateSQL = sprintf("UPDATE administrator SET password=%s, adminname=%s, email_id=%s, contactno=%s WHERE adminid=%s",
                   GetSQLValueString($_POST['pwd'], "text"),
                   GetSQLValueString($_POST['inputName'], "text"),
                   GetSQLValueString($_POST['inputEmail'], "text"),
                   GetSQLValueString($_POST['num'], "text"),
                   GetSQLValueString($_POST['stuid'], "int"));

   mysql_select_db($database_myconn, $myconn);
   $Result1 = mysql_query($updateSQL, $myconn) or die(mysql_error());
    }

  ?>
    <div class="tab-content">
                    <div class="active tab-pane" id="settings">
                    <form action=<?php echo $editFormAction; ?>"" name=form11" method=POSTT" enctype="application/x-www-form-urlencoded" class="form-horizontal" id="form1">
                    <div class="form-group" id="stuid">
                      <label for="stuid" class="col-sm-2 control-label">User ID</label>
                      <div class="col-sm-10">
                        <input name="stuid" type="text" class="form-control"  id="stuid"
                                               value="<?php echo $row_rslinks['adminid']; ?>" readonly>
                      </div>
                    </div>
                    <div class="form-group" id="inputeName">
                      <label for="inputName" class="col-sm-2 control-label">Name</label>
                      <div class="col-sm-10">
                        <input type="text" class="form-control" name="inputName" id="inputName"
                                               value="<?php echo $row_rslinks['adminname']; ?>">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="inputEmail" class="col-sm-2 control-label" >Email</label>
                      <div class="col-sm-10">
                        <input type="email" class="form-control" name="inputEmail" id="inputEmail" 
                                               value="<?php echo $row_rslinks['email_id']; ?>">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="pwd" class="col-sm-2 control-label">Password</label>
                      <div class="col-sm-10">
                        <input type="password" class="form-control" id="pwd" name="pwd" value="">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="rpwd" class="col-sm-2 control-label">Re-Password</label>
                      <div class="col-sm-10">
                        <input type="password" class="form-control" id="rpwd" name="rpwd" value="">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="num" class="col-sm-2 control-label">Mobile</label>
                      <div class="col-sm-10">
                        <input type="text" class="form-control" id="num" name="num" value="<?php echo $row_rslinks['contactno']; ?>">
                      </div>
                    </div><input type="hidden" name="check" id="check" value="2">

                    <div class="form-group">
                      <div class="col-sm-offset-2 col-sm-10">
                        <button type="submit" class="btn btn-primary">Save</button>
                      </div>
                    </div>

““alt=”个人资料图片“>

问题和解决方案:

 <?php if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] ==     "pic_form") &&(($_POST['check'])=== 1)) {
$id=$_POST['monitorimg'];
move_uploaded_file($_FILES['pic']['tmp_name'],"imageupload/".$id);
   $updateSQL = sprintf("UPDATE administrator SET pix=%s WHERE adminid=%s",
                  GetSQLValueString($_POST['monitorimg'], "text"),
                   GetSQLValueString($_POST['ids'], "int"));

    mysqli_select_db($myconn,$database_myconn);
   $Result1 = mysqli_query($myconn,$updateSQL) or    die(mysqli_connect_error());
} 
  ?>      


    <div class="box box-primary">
                    <div class="box-body box-profile">


           <img class="profile-user-img img-responsive img-circle"    width="68" height="68" src="imageupload/<?php echo $row_rslinks['adminid']; ?>".""                     alt="profile picture">
              <form action="<?php echo $editFormAction; ?>" name="pic_form" enctype="multipart/form-data" method="POST">
                   <input type="file" name="pic" class="btn-facebook" required>
                   <input type="submit" class="btn-dropbox" name="sub" id="sub" value="Upload">
                   <input type="hidden" name="ids" id="ids" value="<?php echo $row_rslinks['adminid'];?>">
                   <input type="hidden" name="monitorimg" id="monitorimg" value="<?php echo $row_rslinks['adminid'];?>">
                   <input type="hidden" name="MM_update" value="pic_form">
                  <input type="hidden" name="check" id="check" value="1">
              </form>

                        <h3 class="profile-username text-center"></h3>

                        <p class="text-muted text-center"></p>


  <!-----------This is the second Table code--------------> 


 <?php  if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1") &&(($_POST['check'])=== 1)) {
  $updateSQL = sprintf("UPDATE administrator SET password=%s, adminname=%s, email_id=%s, contactno=%s WHERE adminid=%s",
                   GetSQLValueString($_POST['pwd'], "text"),
                   GetSQLValueString($_POST['inputName'], "text"),
                   GetSQLValueString($_POST['inputEmail'], "text"),
                   GetSQLValueString($_POST['num'], "text"),
                   GetSQLValueString($_POST['stuid'], "int"));

   mysql_select_db($database_myconn, $myconn);
   $Result1 = mysql_query($updateSQL, $myconn) or die(mysql_error());
    }

  ?>
    <div class="tab-content">
                    <div class="active tab-pane" id="settings">
                    <form action=<?php echo $editFormAction; ?>"" name=form11" method=POSTT" enctype="application/x-www-form-urlencoded" class="form-horizontal" id="form1">
                    <div class="form-group" id="stuid">
                      <label for="stuid" class="col-sm-2 control-label">User ID</label>
                      <div class="col-sm-10">
                        <input name="stuid" type="text" class="form-control"  id="stuid"
                                               value="<?php echo $row_rslinks['adminid']; ?>" readonly>
                      </div>
                    </div>
                    <div class="form-group" id="inputeName">
                      <label for="inputName" class="col-sm-2 control-label">Name</label>
                      <div class="col-sm-10">
                        <input type="text" class="form-control" name="inputName" id="inputName"
                                               value="<?php echo $row_rslinks['adminname']; ?>">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="inputEmail" class="col-sm-2 control-label" >Email</label>
                      <div class="col-sm-10">
                        <input type="email" class="form-control" name="inputEmail" id="inputEmail" 
                                               value="<?php echo $row_rslinks['email_id']; ?>">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="pwd" class="col-sm-2 control-label">Password</label>
                      <div class="col-sm-10">
                        <input type="password" class="form-control" id="pwd" name="pwd" value="">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="rpwd" class="col-sm-2 control-label">Re-Password</label>
                      <div class="col-sm-10">
                        <input type="password" class="form-control" id="rpwd" name="rpwd" value="">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="num" class="col-sm-2 control-label">Mobile</label>
                      <div class="col-sm-10">
                        <input type="text" class="form-control" id="num" name="num" value="<?php echo $row_rslinks['contactno']; ?>">
                      </div>
                    </div><input type="hidden" name="check" id="check" value="2">

                    <div class="form-group">
                      <div class="col-sm-offset-2 col-sm-10">
                        <button type="submit" class="btn btn-primary">Save</button>
                      </div>
                    </div>
我在这里看到的主要问题是,您的第二个表单使用了
method=“POSTT”
。当然,没有像POSTT这样的方法,因此它将默认使用GET方法。删除额外的“T”,它将修复此问题

 <?php if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] ==     "pic_form") &&(($_POST['check'])=== 1)) {
$id=$_POST['monitorimg'];
move_uploaded_file($_FILES['pic']['tmp_name'],"imageupload/".$id);
   $updateSQL = sprintf("UPDATE administrator SET pix=%s WHERE adminid=%s",
                  GetSQLValueString($_POST['monitorimg'], "text"),
                   GetSQLValueString($_POST['ids'], "int"));

    mysqli_select_db($myconn,$database_myconn);
   $Result1 = mysqli_query($myconn,$updateSQL) or    die(mysqli_connect_error());
} 
  ?>      


    <div class="box box-primary">
                    <div class="box-body box-profile">


           <img class="profile-user-img img-responsive img-circle"    width="68" height="68" src="imageupload/<?php echo $row_rslinks['adminid']; ?>".""                     alt="profile picture">
              <form action="<?php echo $editFormAction; ?>" name="pic_form" enctype="multipart/form-data" method="POST">
                   <input type="file" name="pic" class="btn-facebook" required>
                   <input type="submit" class="btn-dropbox" name="sub" id="sub" value="Upload">
                   <input type="hidden" name="ids" id="ids" value="<?php echo $row_rslinks['adminid'];?>">
                   <input type="hidden" name="monitorimg" id="monitorimg" value="<?php echo $row_rslinks['adminid'];?>">
                   <input type="hidden" name="MM_update" value="pic_form">
                  <input type="hidden" name="check" id="check" value="1">
              </form>

                        <h3 class="profile-username text-center"></h3>

                        <p class="text-muted text-center"></p>


  <!-----------This is the second Table code--------------> 


 <?php  if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1") &&(($_POST['check'])=== 1)) {
  $updateSQL = sprintf("UPDATE administrator SET password=%s, adminname=%s, email_id=%s, contactno=%s WHERE adminid=%s",
                   GetSQLValueString($_POST['pwd'], "text"),
                   GetSQLValueString($_POST['inputName'], "text"),
                   GetSQLValueString($_POST['inputEmail'], "text"),
                   GetSQLValueString($_POST['num'], "text"),
                   GetSQLValueString($_POST['stuid'], "int"));

   mysql_select_db($database_myconn, $myconn);
   $Result1 = mysql_query($updateSQL, $myconn) or die(mysql_error());
    }

  ?>
    <div class="tab-content">
                    <div class="active tab-pane" id="settings">
                    <form action=<?php echo $editFormAction; ?>"" name=form11" method=POSTT" enctype="application/x-www-form-urlencoded" class="form-horizontal" id="form1">
                    <div class="form-group" id="stuid">
                      <label for="stuid" class="col-sm-2 control-label">User ID</label>
                      <div class="col-sm-10">
                        <input name="stuid" type="text" class="form-control"  id="stuid"
                                               value="<?php echo $row_rslinks['adminid']; ?>" readonly>
                      </div>
                    </div>
                    <div class="form-group" id="inputeName">
                      <label for="inputName" class="col-sm-2 control-label">Name</label>
                      <div class="col-sm-10">
                        <input type="text" class="form-control" name="inputName" id="inputName"
                                               value="<?php echo $row_rslinks['adminname']; ?>">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="inputEmail" class="col-sm-2 control-label" >Email</label>
                      <div class="col-sm-10">
                        <input type="email" class="form-control" name="inputEmail" id="inputEmail" 
                                               value="<?php echo $row_rslinks['email_id']; ?>">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="pwd" class="col-sm-2 control-label">Password</label>
                      <div class="col-sm-10">
                        <input type="password" class="form-control" id="pwd" name="pwd" value="">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="rpwd" class="col-sm-2 control-label">Re-Password</label>
                      <div class="col-sm-10">
                        <input type="password" class="form-control" id="rpwd" name="rpwd" value="">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="num" class="col-sm-2 control-label">Mobile</label>
                      <div class="col-sm-10">
                        <input type="text" class="form-control" id="num" name="num" value="<?php echo $row_rslinks['contactno']; ?>">
                      </div>
                    </div><input type="hidden" name="check" id="check" value="2">

                    <div class="form-group">
                      <div class="col-sm-offset-2 col-sm-10">
                        <button type="submit" class="btn btn-primary">Save</button>
                      </div>
                    </div>
如何分步调试:

 <?php if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] ==     "pic_form") &&(($_POST['check'])=== 1)) {
$id=$_POST['monitorimg'];
move_uploaded_file($_FILES['pic']['tmp_name'],"imageupload/".$id);
   $updateSQL = sprintf("UPDATE administrator SET pix=%s WHERE adminid=%s",
                  GetSQLValueString($_POST['monitorimg'], "text"),
                   GetSQLValueString($_POST['ids'], "int"));

    mysqli_select_db($myconn,$database_myconn);
   $Result1 = mysqli_query($myconn,$updateSQL) or    die(mysqli_connect_error());
} 
  ?>      


    <div class="box box-primary">
                    <div class="box-body box-profile">


           <img class="profile-user-img img-responsive img-circle"    width="68" height="68" src="imageupload/<?php echo $row_rslinks['adminid']; ?>".""                     alt="profile picture">
              <form action="<?php echo $editFormAction; ?>" name="pic_form" enctype="multipart/form-data" method="POST">
                   <input type="file" name="pic" class="btn-facebook" required>
                   <input type="submit" class="btn-dropbox" name="sub" id="sub" value="Upload">
                   <input type="hidden" name="ids" id="ids" value="<?php echo $row_rslinks['adminid'];?>">
                   <input type="hidden" name="monitorimg" id="monitorimg" value="<?php echo $row_rslinks['adminid'];?>">
                   <input type="hidden" name="MM_update" value="pic_form">
                  <input type="hidden" name="check" id="check" value="1">
              </form>

                        <h3 class="profile-username text-center"></h3>

                        <p class="text-muted text-center"></p>


  <!-----------This is the second Table code--------------> 


 <?php  if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1") &&(($_POST['check'])=== 1)) {
  $updateSQL = sprintf("UPDATE administrator SET password=%s, adminname=%s, email_id=%s, contactno=%s WHERE adminid=%s",
                   GetSQLValueString($_POST['pwd'], "text"),
                   GetSQLValueString($_POST['inputName'], "text"),
                   GetSQLValueString($_POST['inputEmail'], "text"),
                   GetSQLValueString($_POST['num'], "text"),
                   GetSQLValueString($_POST['stuid'], "int"));

   mysql_select_db($database_myconn, $myconn);
   $Result1 = mysql_query($updateSQL, $myconn) or die(mysql_error());
    }

  ?>
    <div class="tab-content">
                    <div class="active tab-pane" id="settings">
                    <form action=<?php echo $editFormAction; ?>"" name=form11" method=POSTT" enctype="application/x-www-form-urlencoded" class="form-horizontal" id="form1">
                    <div class="form-group" id="stuid">
                      <label for="stuid" class="col-sm-2 control-label">User ID</label>
                      <div class="col-sm-10">
                        <input name="stuid" type="text" class="form-control"  id="stuid"
                                               value="<?php echo $row_rslinks['adminid']; ?>" readonly>
                      </div>
                    </div>
                    <div class="form-group" id="inputeName">
                      <label for="inputName" class="col-sm-2 control-label">Name</label>
                      <div class="col-sm-10">
                        <input type="text" class="form-control" name="inputName" id="inputName"
                                               value="<?php echo $row_rslinks['adminname']; ?>">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="inputEmail" class="col-sm-2 control-label" >Email</label>
                      <div class="col-sm-10">
                        <input type="email" class="form-control" name="inputEmail" id="inputEmail" 
                                               value="<?php echo $row_rslinks['email_id']; ?>">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="pwd" class="col-sm-2 control-label">Password</label>
                      <div class="col-sm-10">
                        <input type="password" class="form-control" id="pwd" name="pwd" value="">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="rpwd" class="col-sm-2 control-label">Re-Password</label>
                      <div class="col-sm-10">
                        <input type="password" class="form-control" id="rpwd" name="rpwd" value="">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="num" class="col-sm-2 control-label">Mobile</label>
                      <div class="col-sm-10">
                        <input type="text" class="form-control" id="num" name="num" value="<?php echo $row_rslinks['contactno']; ?>">
                      </div>
                    </div><input type="hidden" name="check" id="check" value="2">

                    <div class="form-group">
                      <div class="col-sm-offset-2 col-sm-10">
                        <button type="submit" class="btn btn-primary">Save</button>
                      </div>
                    </div>
我还建议应用一些常见的调试技术来跟踪将来可能遇到的任何错误

 <?php if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] ==     "pic_form") &&(($_POST['check'])=== 1)) {
$id=$_POST['monitorimg'];
move_uploaded_file($_FILES['pic']['tmp_name'],"imageupload/".$id);
   $updateSQL = sprintf("UPDATE administrator SET pix=%s WHERE adminid=%s",
                  GetSQLValueString($_POST['monitorimg'], "text"),
                   GetSQLValueString($_POST['ids'], "int"));

    mysqli_select_db($myconn,$database_myconn);
   $Result1 = mysqli_query($myconn,$updateSQL) or    die(mysqli_connect_error());
} 
  ?>      


    <div class="box box-primary">
                    <div class="box-body box-profile">


           <img class="profile-user-img img-responsive img-circle"    width="68" height="68" src="imageupload/<?php echo $row_rslinks['adminid']; ?>".""                     alt="profile picture">
              <form action="<?php echo $editFormAction; ?>" name="pic_form" enctype="multipart/form-data" method="POST">
                   <input type="file" name="pic" class="btn-facebook" required>
                   <input type="submit" class="btn-dropbox" name="sub" id="sub" value="Upload">
                   <input type="hidden" name="ids" id="ids" value="<?php echo $row_rslinks['adminid'];?>">
                   <input type="hidden" name="monitorimg" id="monitorimg" value="<?php echo $row_rslinks['adminid'];?>">
                   <input type="hidden" name="MM_update" value="pic_form">
                  <input type="hidden" name="check" id="check" value="1">
              </form>

                        <h3 class="profile-username text-center"></h3>

                        <p class="text-muted text-center"></p>


  <!-----------This is the second Table code--------------> 


 <?php  if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1") &&(($_POST['check'])=== 1)) {
  $updateSQL = sprintf("UPDATE administrator SET password=%s, adminname=%s, email_id=%s, contactno=%s WHERE adminid=%s",
                   GetSQLValueString($_POST['pwd'], "text"),
                   GetSQLValueString($_POST['inputName'], "text"),
                   GetSQLValueString($_POST['inputEmail'], "text"),
                   GetSQLValueString($_POST['num'], "text"),
                   GetSQLValueString($_POST['stuid'], "int"));

   mysql_select_db($database_myconn, $myconn);
   $Result1 = mysql_query($updateSQL, $myconn) or die(mysql_error());
    }

  ?>
    <div class="tab-content">
                    <div class="active tab-pane" id="settings">
                    <form action=<?php echo $editFormAction; ?>"" name=form11" method=POSTT" enctype="application/x-www-form-urlencoded" class="form-horizontal" id="form1">
                    <div class="form-group" id="stuid">
                      <label for="stuid" class="col-sm-2 control-label">User ID</label>
                      <div class="col-sm-10">
                        <input name="stuid" type="text" class="form-control"  id="stuid"
                                               value="<?php echo $row_rslinks['adminid']; ?>" readonly>
                      </div>
                    </div>
                    <div class="form-group" id="inputeName">
                      <label for="inputName" class="col-sm-2 control-label">Name</label>
                      <div class="col-sm-10">
                        <input type="text" class="form-control" name="inputName" id="inputName"
                                               value="<?php echo $row_rslinks['adminname']; ?>">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="inputEmail" class="col-sm-2 control-label" >Email</label>
                      <div class="col-sm-10">
                        <input type="email" class="form-control" name="inputEmail" id="inputEmail" 
                                               value="<?php echo $row_rslinks['email_id']; ?>">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="pwd" class="col-sm-2 control-label">Password</label>
                      <div class="col-sm-10">
                        <input type="password" class="form-control" id="pwd" name="pwd" value="">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="rpwd" class="col-sm-2 control-label">Re-Password</label>
                      <div class="col-sm-10">
                        <input type="password" class="form-control" id="rpwd" name="rpwd" value="">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="num" class="col-sm-2 control-label">Mobile</label>
                      <div class="col-sm-10">
                        <input type="text" class="form-control" id="num" name="num" value="<?php echo $row_rslinks['contactno']; ?>">
                      </div>
                    </div><input type="hidden" name="check" id="check" value="2">

                    <div class="form-group">
                      <div class="col-sm-offset-2 col-sm-10">
                        <button type="submit" class="btn btn-primary">Save</button>
                      </div>
                    </div>
第1步:检查PHP错误日志,确保它们报告错误

 <?php if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] ==     "pic_form") &&(($_POST['check'])=== 1)) {
$id=$_POST['monitorimg'];
move_uploaded_file($_FILES['pic']['tmp_name'],"imageupload/".$id);
   $updateSQL = sprintf("UPDATE administrator SET pix=%s WHERE adminid=%s",
                  GetSQLValueString($_POST['monitorimg'], "text"),
                   GetSQLValueString($_POST['ids'], "int"));

    mysqli_select_db($myconn,$database_myconn);
   $Result1 = mysqli_query($myconn,$updateSQL) or    die(mysqli_connect_error());
} 
  ?>      


    <div class="box box-primary">
                    <div class="box-body box-profile">


           <img class="profile-user-img img-responsive img-circle"    width="68" height="68" src="imageupload/<?php echo $row_rslinks['adminid']; ?>".""                     alt="profile picture">
              <form action="<?php echo $editFormAction; ?>" name="pic_form" enctype="multipart/form-data" method="POST">
                   <input type="file" name="pic" class="btn-facebook" required>
                   <input type="submit" class="btn-dropbox" name="sub" id="sub" value="Upload">
                   <input type="hidden" name="ids" id="ids" value="<?php echo $row_rslinks['adminid'];?>">
                   <input type="hidden" name="monitorimg" id="monitorimg" value="<?php echo $row_rslinks['adminid'];?>">
                   <input type="hidden" name="MM_update" value="pic_form">
                  <input type="hidden" name="check" id="check" value="1">
              </form>

                        <h3 class="profile-username text-center"></h3>

                        <p class="text-muted text-center"></p>


  <!-----------This is the second Table code--------------> 


 <?php  if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1") &&(($_POST['check'])=== 1)) {
  $updateSQL = sprintf("UPDATE administrator SET password=%s, adminname=%s, email_id=%s, contactno=%s WHERE adminid=%s",
                   GetSQLValueString($_POST['pwd'], "text"),
                   GetSQLValueString($_POST['inputName'], "text"),
                   GetSQLValueString($_POST['inputEmail'], "text"),
                   GetSQLValueString($_POST['num'], "text"),
                   GetSQLValueString($_POST['stuid'], "int"));

   mysql_select_db($database_myconn, $myconn);
   $Result1 = mysql_query($updateSQL, $myconn) or die(mysql_error());
    }

  ?>
    <div class="tab-content">
                    <div class="active tab-pane" id="settings">
                    <form action=<?php echo $editFormAction; ?>"" name=form11" method=POSTT" enctype="application/x-www-form-urlencoded" class="form-horizontal" id="form1">
                    <div class="form-group" id="stuid">
                      <label for="stuid" class="col-sm-2 control-label">User ID</label>
                      <div class="col-sm-10">
                        <input name="stuid" type="text" class="form-control"  id="stuid"
                                               value="<?php echo $row_rslinks['adminid']; ?>" readonly>
                      </div>
                    </div>
                    <div class="form-group" id="inputeName">
                      <label for="inputName" class="col-sm-2 control-label">Name</label>
                      <div class="col-sm-10">
                        <input type="text" class="form-control" name="inputName" id="inputName"
                                               value="<?php echo $row_rslinks['adminname']; ?>">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="inputEmail" class="col-sm-2 control-label" >Email</label>
                      <div class="col-sm-10">
                        <input type="email" class="form-control" name="inputEmail" id="inputEmail" 
                                               value="<?php echo $row_rslinks['email_id']; ?>">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="pwd" class="col-sm-2 control-label">Password</label>
                      <div class="col-sm-10">
                        <input type="password" class="form-control" id="pwd" name="pwd" value="">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="rpwd" class="col-sm-2 control-label">Re-Password</label>
                      <div class="col-sm-10">
                        <input type="password" class="form-control" id="rpwd" name="rpwd" value="">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="num" class="col-sm-2 control-label">Mobile</label>
                      <div class="col-sm-10">
                        <input type="text" class="form-control" id="num" name="num" value="<?php echo $row_rslinks['contactno']; ?>">
                      </div>
                    </div><input type="hidden" name="check" id="check" value="2">

                    <div class="form-group">
                      <div class="col-sm-offset-2 col-sm-10">
                        <button type="submit" class="btn btn-primary">Save</button>
                      </div>
                    </div>
第2步:在浏览器中查看生成的源代码,并通过诸如

 <?php if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] ==     "pic_form") &&(($_POST['check'])=== 1)) {
$id=$_POST['monitorimg'];
move_uploaded_file($_FILES['pic']['tmp_name'],"imageupload/".$id);
   $updateSQL = sprintf("UPDATE administrator SET pix=%s WHERE adminid=%s",
                  GetSQLValueString($_POST['monitorimg'], "text"),
                   GetSQLValueString($_POST['ids'], "int"));

    mysqli_select_db($myconn,$database_myconn);
   $Result1 = mysqli_query($myconn,$updateSQL) or    die(mysqli_connect_error());
} 
  ?>      


    <div class="box box-primary">
                    <div class="box-body box-profile">


           <img class="profile-user-img img-responsive img-circle"    width="68" height="68" src="imageupload/<?php echo $row_rslinks['adminid']; ?>".""                     alt="profile picture">
              <form action="<?php echo $editFormAction; ?>" name="pic_form" enctype="multipart/form-data" method="POST">
                   <input type="file" name="pic" class="btn-facebook" required>
                   <input type="submit" class="btn-dropbox" name="sub" id="sub" value="Upload">
                   <input type="hidden" name="ids" id="ids" value="<?php echo $row_rslinks['adminid'];?>">
                   <input type="hidden" name="monitorimg" id="monitorimg" value="<?php echo $row_rslinks['adminid'];?>">
                   <input type="hidden" name="MM_update" value="pic_form">
                  <input type="hidden" name="check" id="check" value="1">
              </form>

                        <h3 class="profile-username text-center"></h3>

                        <p class="text-muted text-center"></p>


  <!-----------This is the second Table code--------------> 


 <?php  if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1") &&(($_POST['check'])=== 1)) {
  $updateSQL = sprintf("UPDATE administrator SET password=%s, adminname=%s, email_id=%s, contactno=%s WHERE adminid=%s",
                   GetSQLValueString($_POST['pwd'], "text"),
                   GetSQLValueString($_POST['inputName'], "text"),
                   GetSQLValueString($_POST['inputEmail'], "text"),
                   GetSQLValueString($_POST['num'], "text"),
                   GetSQLValueString($_POST['stuid'], "int"));

   mysql_select_db($database_myconn, $myconn);
   $Result1 = mysql_query($updateSQL, $myconn) or die(mysql_error());
    }

  ?>
    <div class="tab-content">
                    <div class="active tab-pane" id="settings">
                    <form action=<?php echo $editFormAction; ?>"" name=form11" method=POSTT" enctype="application/x-www-form-urlencoded" class="form-horizontal" id="form1">
                    <div class="form-group" id="stuid">
                      <label for="stuid" class="col-sm-2 control-label">User ID</label>
                      <div class="col-sm-10">
                        <input name="stuid" type="text" class="form-control"  id="stuid"
                                               value="<?php echo $row_rslinks['adminid']; ?>" readonly>
                      </div>
                    </div>
                    <div class="form-group" id="inputeName">
                      <label for="inputName" class="col-sm-2 control-label">Name</label>
                      <div class="col-sm-10">
                        <input type="text" class="form-control" name="inputName" id="inputName"
                                               value="<?php echo $row_rslinks['adminname']; ?>">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="inputEmail" class="col-sm-2 control-label" >Email</label>
                      <div class="col-sm-10">
                        <input type="email" class="form-control" name="inputEmail" id="inputEmail" 
                                               value="<?php echo $row_rslinks['email_id']; ?>">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="pwd" class="col-sm-2 control-label">Password</label>
                      <div class="col-sm-10">
                        <input type="password" class="form-control" id="pwd" name="pwd" value="">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="rpwd" class="col-sm-2 control-label">Re-Password</label>
                      <div class="col-sm-10">
                        <input type="password" class="form-control" id="rpwd" name="rpwd" value="">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="num" class="col-sm-2 control-label">Mobile</label>
                      <div class="col-sm-10">
                        <input type="text" class="form-control" id="num" name="num" value="<?php echo $row_rslinks['contactno']; ?>">
                      </div>
                    </div><input type="hidden" name="check" id="check" value="2">

                    <div class="form-group">
                      <div class="col-sm-offset-2 col-sm-10">
                        <button type="submit" class="btn btn-primary">Save</button>
                      </div>
                    </div>
第3步:如果没有遇到上述错误,请在整个程序的不同位置或至少在问题区域使用大量echo语句。例如,如果您放置了echo语句,例如:

 <?php if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] ==     "pic_form") &&(($_POST['check'])=== 1)) {
$id=$_POST['monitorimg'];
move_uploaded_file($_FILES['pic']['tmp_name'],"imageupload/".$id);
   $updateSQL = sprintf("UPDATE administrator SET pix=%s WHERE adminid=%s",
                  GetSQLValueString($_POST['monitorimg'], "text"),
                   GetSQLValueString($_POST['ids'], "int"));

    mysqli_select_db($myconn,$database_myconn);
   $Result1 = mysqli_query($myconn,$updateSQL) or    die(mysqli_connect_error());
} 
  ?>      


    <div class="box box-primary">
                    <div class="box-body box-profile">


           <img class="profile-user-img img-responsive img-circle"    width="68" height="68" src="imageupload/<?php echo $row_rslinks['adminid']; ?>".""                     alt="profile picture">
              <form action="<?php echo $editFormAction; ?>" name="pic_form" enctype="multipart/form-data" method="POST">
                   <input type="file" name="pic" class="btn-facebook" required>
                   <input type="submit" class="btn-dropbox" name="sub" id="sub" value="Upload">
                   <input type="hidden" name="ids" id="ids" value="<?php echo $row_rslinks['adminid'];?>">
                   <input type="hidden" name="monitorimg" id="monitorimg" value="<?php echo $row_rslinks['adminid'];?>">
                   <input type="hidden" name="MM_update" value="pic_form">
                  <input type="hidden" name="check" id="check" value="1">
              </form>

                        <h3 class="profile-username text-center"></h3>

                        <p class="text-muted text-center"></p>


  <!-----------This is the second Table code--------------> 


 <?php  if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1") &&(($_POST['check'])=== 1)) {
  $updateSQL = sprintf("UPDATE administrator SET password=%s, adminname=%s, email_id=%s, contactno=%s WHERE adminid=%s",
                   GetSQLValueString($_POST['pwd'], "text"),
                   GetSQLValueString($_POST['inputName'], "text"),
                   GetSQLValueString($_POST['inputEmail'], "text"),
                   GetSQLValueString($_POST['num'], "text"),
                   GetSQLValueString($_POST['stuid'], "int"));

   mysql_select_db($database_myconn, $myconn);
   $Result1 = mysql_query($updateSQL, $myconn) or die(mysql_error());
    }

  ?>
    <div class="tab-content">
                    <div class="active tab-pane" id="settings">
                    <form action=<?php echo $editFormAction; ?>"" name=form11" method=POSTT" enctype="application/x-www-form-urlencoded" class="form-horizontal" id="form1">
                    <div class="form-group" id="stuid">
                      <label for="stuid" class="col-sm-2 control-label">User ID</label>
                      <div class="col-sm-10">
                        <input name="stuid" type="text" class="form-control"  id="stuid"
                                               value="<?php echo $row_rslinks['adminid']; ?>" readonly>
                      </div>
                    </div>
                    <div class="form-group" id="inputeName">
                      <label for="inputName" class="col-sm-2 control-label">Name</label>
                      <div class="col-sm-10">
                        <input type="text" class="form-control" name="inputName" id="inputName"
                                               value="<?php echo $row_rslinks['adminname']; ?>">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="inputEmail" class="col-sm-2 control-label" >Email</label>
                      <div class="col-sm-10">
                        <input type="email" class="form-control" name="inputEmail" id="inputEmail" 
                                               value="<?php echo $row_rslinks['email_id']; ?>">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="pwd" class="col-sm-2 control-label">Password</label>
                      <div class="col-sm-10">
                        <input type="password" class="form-control" id="pwd" name="pwd" value="">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="rpwd" class="col-sm-2 control-label">Re-Password</label>
                      <div class="col-sm-10">
                        <input type="password" class="form-control" id="rpwd" name="rpwd" value="">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="num" class="col-sm-2 control-label">Mobile</label>
                      <div class="col-sm-10">
                        <input type="text" class="form-control" id="num" name="num" value="<?php echo $row_rslinks['contactno']; ?>">
                      </div>
                    </div><input type="hidden" name="check" id="check" value="2">

                    <div class="form-group">
                      <div class="col-sm-offset-2 col-sm-10">
                        <button type="submit" class="btn btn-primary">Save</button>
                      </div>
                    </div>
echo "Second if block"; 
echo "<pre>";
echo "GET:";
print_r($_GET);
echo "POST:";
print_r($_POST);
echo "</pre>";
(我经常有点过火,在我的程序中放置echo语句,以防我忽略了什么。如果是这种情况,我通常只使用数字,例如……
echo 7;
echo 8
…,等等。在每个代码块之前、之后和内部)

 <?php if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] ==     "pic_form") &&(($_POST['check'])=== 1)) {
$id=$_POST['monitorimg'];
move_uploaded_file($_FILES['pic']['tmp_name'],"imageupload/".$id);
   $updateSQL = sprintf("UPDATE administrator SET pix=%s WHERE adminid=%s",
                  GetSQLValueString($_POST['monitorimg'], "text"),
                   GetSQLValueString($_POST['ids'], "int"));

    mysqli_select_db($myconn,$database_myconn);
   $Result1 = mysqli_query($myconn,$updateSQL) or    die(mysqli_connect_error());
} 
  ?>      


    <div class="box box-primary">
                    <div class="box-body box-profile">


           <img class="profile-user-img img-responsive img-circle"    width="68" height="68" src="imageupload/<?php echo $row_rslinks['adminid']; ?>".""                     alt="profile picture">
              <form action="<?php echo $editFormAction; ?>" name="pic_form" enctype="multipart/form-data" method="POST">
                   <input type="file" name="pic" class="btn-facebook" required>
                   <input type="submit" class="btn-dropbox" name="sub" id="sub" value="Upload">
                   <input type="hidden" name="ids" id="ids" value="<?php echo $row_rslinks['adminid'];?>">
                   <input type="hidden" name="monitorimg" id="monitorimg" value="<?php echo $row_rslinks['adminid'];?>">
                   <input type="hidden" name="MM_update" value="pic_form">
                  <input type="hidden" name="check" id="check" value="1">
              </form>

                        <h3 class="profile-username text-center"></h3>

                        <p class="text-muted text-center"></p>


  <!-----------This is the second Table code--------------> 


 <?php  if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1") &&(($_POST['check'])=== 1)) {
  $updateSQL = sprintf("UPDATE administrator SET password=%s, adminname=%s, email_id=%s, contactno=%s WHERE adminid=%s",
                   GetSQLValueString($_POST['pwd'], "text"),
                   GetSQLValueString($_POST['inputName'], "text"),
                   GetSQLValueString($_POST['inputEmail'], "text"),
                   GetSQLValueString($_POST['num'], "text"),
                   GetSQLValueString($_POST['stuid'], "int"));

   mysql_select_db($database_myconn, $myconn);
   $Result1 = mysql_query($updateSQL, $myconn) or die(mysql_error());
    }

  ?>
    <div class="tab-content">
                    <div class="active tab-pane" id="settings">
                    <form action=<?php echo $editFormAction; ?>"" name=form11" method=POSTT" enctype="application/x-www-form-urlencoded" class="form-horizontal" id="form1">
                    <div class="form-group" id="stuid">
                      <label for="stuid" class="col-sm-2 control-label">User ID</label>
                      <div class="col-sm-10">
                        <input name="stuid" type="text" class="form-control"  id="stuid"
                                               value="<?php echo $row_rslinks['adminid']; ?>" readonly>
                      </div>
                    </div>
                    <div class="form-group" id="inputeName">
                      <label for="inputName" class="col-sm-2 control-label">Name</label>
                      <div class="col-sm-10">
                        <input type="text" class="form-control" name="inputName" id="inputName"
                                               value="<?php echo $row_rslinks['adminname']; ?>">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="inputEmail" class="col-sm-2 control-label" >Email</label>
                      <div class="col-sm-10">
                        <input type="email" class="form-control" name="inputEmail" id="inputEmail" 
                                               value="<?php echo $row_rslinks['email_id']; ?>">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="pwd" class="col-sm-2 control-label">Password</label>
                      <div class="col-sm-10">
                        <input type="password" class="form-control" id="pwd" name="pwd" value="">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="rpwd" class="col-sm-2 control-label">Re-Password</label>
                      <div class="col-sm-10">
                        <input type="password" class="form-control" id="rpwd" name="rpwd" value="">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="num" class="col-sm-2 control-label">Mobile</label>
                      <div class="col-sm-10">
                        <input type="text" class="form-control" id="num" name="num" value="<?php echo $row_rslinks['contactno']; ?>">
                      </div>
                    </div><input type="hidden" name="check" id="check" value="2">

                    <div class="form-group">
                      <div class="col-sm-offset-2 col-sm-10">
                        <button type="submit" class="btn btn-primary">Save</button>
                      </div>
                    </div>
在第二个if块内部,您可能会注意到它没有运行。这会让您知道,包含$\u POST变量的if语句的计算结果为false。正如您所知,它的计算结果应该为true,您知道这是问题的根源。然后,您可以将表单变量的内容显示为fo允许:

 <?php if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] ==     "pic_form") &&(($_POST['check'])=== 1)) {
$id=$_POST['monitorimg'];
move_uploaded_file($_FILES['pic']['tmp_name'],"imageupload/".$id);
   $updateSQL = sprintf("UPDATE administrator SET pix=%s WHERE adminid=%s",
                  GetSQLValueString($_POST['monitorimg'], "text"),
                   GetSQLValueString($_POST['ids'], "int"));

    mysqli_select_db($myconn,$database_myconn);
   $Result1 = mysqli_query($myconn,$updateSQL) or    die(mysqli_connect_error());
} 
  ?>      


    <div class="box box-primary">
                    <div class="box-body box-profile">


           <img class="profile-user-img img-responsive img-circle"    width="68" height="68" src="imageupload/<?php echo $row_rslinks['adminid']; ?>".""                     alt="profile picture">
              <form action="<?php echo $editFormAction; ?>" name="pic_form" enctype="multipart/form-data" method="POST">
                   <input type="file" name="pic" class="btn-facebook" required>
                   <input type="submit" class="btn-dropbox" name="sub" id="sub" value="Upload">
                   <input type="hidden" name="ids" id="ids" value="<?php echo $row_rslinks['adminid'];?>">
                   <input type="hidden" name="monitorimg" id="monitorimg" value="<?php echo $row_rslinks['adminid'];?>">
                   <input type="hidden" name="MM_update" value="pic_form">
                  <input type="hidden" name="check" id="check" value="1">
              </form>

                        <h3 class="profile-username text-center"></h3>

                        <p class="text-muted text-center"></p>


  <!-----------This is the second Table code--------------> 


 <?php  if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1") &&(($_POST['check'])=== 1)) {
  $updateSQL = sprintf("UPDATE administrator SET password=%s, adminname=%s, email_id=%s, contactno=%s WHERE adminid=%s",
                   GetSQLValueString($_POST['pwd'], "text"),
                   GetSQLValueString($_POST['inputName'], "text"),
                   GetSQLValueString($_POST['inputEmail'], "text"),
                   GetSQLValueString($_POST['num'], "text"),
                   GetSQLValueString($_POST['stuid'], "int"));

   mysql_select_db($database_myconn, $myconn);
   $Result1 = mysql_query($updateSQL, $myconn) or die(mysql_error());
    }

  ?>
    <div class="tab-content">
                    <div class="active tab-pane" id="settings">
                    <form action=<?php echo $editFormAction; ?>"" name=form11" method=POSTT" enctype="application/x-www-form-urlencoded" class="form-horizontal" id="form1">
                    <div class="form-group" id="stuid">
                      <label for="stuid" class="col-sm-2 control-label">User ID</label>
                      <div class="col-sm-10">
                        <input name="stuid" type="text" class="form-control"  id="stuid"
                                               value="<?php echo $row_rslinks['adminid']; ?>" readonly>
                      </div>
                    </div>
                    <div class="form-group" id="inputeName">
                      <label for="inputName" class="col-sm-2 control-label">Name</label>
                      <div class="col-sm-10">
                        <input type="text" class="form-control" name="inputName" id="inputName"
                                               value="<?php echo $row_rslinks['adminname']; ?>">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="inputEmail" class="col-sm-2 control-label" >Email</label>
                      <div class="col-sm-10">
                        <input type="email" class="form-control" name="inputEmail" id="inputEmail" 
                                               value="<?php echo $row_rslinks['email_id']; ?>">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="pwd" class="col-sm-2 control-label">Password</label>
                      <div class="col-sm-10">
                        <input type="password" class="form-control" id="pwd" name="pwd" value="">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="rpwd" class="col-sm-2 control-label">Re-Password</label>
                      <div class="col-sm-10">
                        <input type="password" class="form-control" id="rpwd" name="rpwd" value="">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="num" class="col-sm-2 control-label">Mobile</label>
                      <div class="col-sm-10">
                        <input type="text" class="form-control" id="num" name="num" value="<?php echo $row_rslinks['contactno']; ?>">
                      </div>
                    </div><input type="hidden" name="check" id="check" value="2">

                    <div class="form-group">
                      <div class="col-sm-offset-2 col-sm-10">
                        <button type="submit" class="btn btn-primary">Save</button>
                      </div>
                    </div>
echo”“;
回声“得到:”;
打印(美元);;
回声“帖子:”;
打印(邮政美元);
回声“;
这将向您显示数据在$\u GET变量中,而不是您预期的$\u POST变量中

 <?php if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] ==     "pic_form") &&(($_POST['check'])=== 1)) {
$id=$_POST['monitorimg'];
move_uploaded_file($_FILES['pic']['tmp_name'],"imageupload/".$id);
   $updateSQL = sprintf("UPDATE administrator SET pix=%s WHERE adminid=%s",
                  GetSQLValueString($_POST['monitorimg'], "text"),
                   GetSQLValueString($_POST['ids'], "int"));

    mysqli_select_db($myconn,$database_myconn);
   $Result1 = mysqli_query($myconn,$updateSQL) or    die(mysqli_connect_error());
} 
  ?>      


    <div class="box box-primary">
                    <div class="box-body box-profile">


           <img class="profile-user-img img-responsive img-circle"    width="68" height="68" src="imageupload/<?php echo $row_rslinks['adminid']; ?>".""                     alt="profile picture">
              <form action="<?php echo $editFormAction; ?>" name="pic_form" enctype="multipart/form-data" method="POST">
                   <input type="file" name="pic" class="btn-facebook" required>
                   <input type="submit" class="btn-dropbox" name="sub" id="sub" value="Upload">
                   <input type="hidden" name="ids" id="ids" value="<?php echo $row_rslinks['adminid'];?>">
                   <input type="hidden" name="monitorimg" id="monitorimg" value="<?php echo $row_rslinks['adminid'];?>">
                   <input type="hidden" name="MM_update" value="pic_form">
                  <input type="hidden" name="check" id="check" value="1">
              </form>

                        <h3 class="profile-username text-center"></h3>

                        <p class="text-muted text-center"></p>


  <!-----------This is the second Table code--------------> 


 <?php  if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1") &&(($_POST['check'])=== 1)) {
  $updateSQL = sprintf("UPDATE administrator SET password=%s, adminname=%s, email_id=%s, contactno=%s WHERE adminid=%s",
                   GetSQLValueString($_POST['pwd'], "text"),
                   GetSQLValueString($_POST['inputName'], "text"),
                   GetSQLValueString($_POST['inputEmail'], "text"),
                   GetSQLValueString($_POST['num'], "text"),
                   GetSQLValueString($_POST['stuid'], "int"));

   mysql_select_db($database_myconn, $myconn);
   $Result1 = mysql_query($updateSQL, $myconn) or die(mysql_error());
    }

  ?>
    <div class="tab-content">
                    <div class="active tab-pane" id="settings">
                    <form action=<?php echo $editFormAction; ?>"" name=form11" method=POSTT" enctype="application/x-www-form-urlencoded" class="form-horizontal" id="form1">
                    <div class="form-group" id="stuid">
                      <label for="stuid" class="col-sm-2 control-label">User ID</label>
                      <div class="col-sm-10">
                        <input name="stuid" type="text" class="form-control"  id="stuid"
                                               value="<?php echo $row_rslinks['adminid']; ?>" readonly>
                      </div>
                    </div>
                    <div class="form-group" id="inputeName">
                      <label for="inputName" class="col-sm-2 control-label">Name</label>
                      <div class="col-sm-10">
                        <input type="text" class="form-control" name="inputName" id="inputName"
                                               value="<?php echo $row_rslinks['adminname']; ?>">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="inputEmail" class="col-sm-2 control-label" >Email</label>
                      <div class="col-sm-10">
                        <input type="email" class="form-control" name="inputEmail" id="inputEmail" 
                                               value="<?php echo $row_rslinks['email_id']; ?>">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="pwd" class="col-sm-2 control-label">Password</label>
                      <div class="col-sm-10">
                        <input type="password" class="form-control" id="pwd" name="pwd" value="">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="rpwd" class="col-sm-2 control-label">Re-Password</label>
                      <div class="col-sm-10">
                        <input type="password" class="form-control" id="rpwd" name="rpwd" value="">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="num" class="col-sm-2 control-label">Mobile</label>
                      <div class="col-sm-10">
                        <input type="text" class="form-control" id="num" name="num" value="<?php echo $row_rslinks['contactno']; ?>">
                      </div>
                    </div><input type="hidden" name="check" id="check" value="2">

                    <div class="form-group">
                      <div class="col-sm-offset-2 col-sm-10">
                        <button type="submit" class="btn btn-primary">Save</button>
                      </div>
                    </div>
步骤4:如果在前面的任何步骤中未检测到错误,则最后一步是验证SQL语句是否正确。请尝试在SQL环境中直接在PHP外部运行SQL语句,查看是否有错误。此外,请将PHP脚本设置为显示SQL错误

 <?php if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] ==     "pic_form") &&(($_POST['check'])=== 1)) {
$id=$_POST['monitorimg'];
move_uploaded_file($_FILES['pic']['tmp_name'],"imageupload/".$id);
   $updateSQL = sprintf("UPDATE administrator SET pix=%s WHERE adminid=%s",
                  GetSQLValueString($_POST['monitorimg'], "text"),
                   GetSQLValueString($_POST['ids'], "int"));

    mysqli_select_db($myconn,$database_myconn);
   $Result1 = mysqli_query($myconn,$updateSQL) or    die(mysqli_connect_error());
} 
  ?>      


    <div class="box box-primary">
                    <div class="box-body box-profile">


           <img class="profile-user-img img-responsive img-circle"    width="68" height="68" src="imageupload/<?php echo $row_rslinks['adminid']; ?>".""                     alt="profile picture">
              <form action="<?php echo $editFormAction; ?>" name="pic_form" enctype="multipart/form-data" method="POST">
                   <input type="file" name="pic" class="btn-facebook" required>
                   <input type="submit" class="btn-dropbox" name="sub" id="sub" value="Upload">
                   <input type="hidden" name="ids" id="ids" value="<?php echo $row_rslinks['adminid'];?>">
                   <input type="hidden" name="monitorimg" id="monitorimg" value="<?php echo $row_rslinks['adminid'];?>">
                   <input type="hidden" name="MM_update" value="pic_form">
                  <input type="hidden" name="check" id="check" value="1">
              </form>

                        <h3 class="profile-username text-center"></h3>

                        <p class="text-muted text-center"></p>


  <!-----------This is the second Table code--------------> 


 <?php  if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1") &&(($_POST['check'])=== 1)) {
  $updateSQL = sprintf("UPDATE administrator SET password=%s, adminname=%s, email_id=%s, contactno=%s WHERE adminid=%s",
                   GetSQLValueString($_POST['pwd'], "text"),
                   GetSQLValueString($_POST['inputName'], "text"),
                   GetSQLValueString($_POST['inputEmail'], "text"),
                   GetSQLValueString($_POST['num'], "text"),
                   GetSQLValueString($_POST['stuid'], "int"));

   mysql_select_db($database_myconn, $myconn);
   $Result1 = mysql_query($updateSQL, $myconn) or die(mysql_error());
    }

  ?>
    <div class="tab-content">
                    <div class="active tab-pane" id="settings">
                    <form action=<?php echo $editFormAction; ?>"" name=form11" method=POSTT" enctype="application/x-www-form-urlencoded" class="form-horizontal" id="form1">
                    <div class="form-group" id="stuid">
                      <label for="stuid" class="col-sm-2 control-label">User ID</label>
                      <div class="col-sm-10">
                        <input name="stuid" type="text" class="form-control"  id="stuid"
                                               value="<?php echo $row_rslinks['adminid']; ?>" readonly>
                      </div>
                    </div>
                    <div class="form-group" id="inputeName">
                      <label for="inputName" class="col-sm-2 control-label">Name</label>
                      <div class="col-sm-10">
                        <input type="text" class="form-control" name="inputName" id="inputName"
                                               value="<?php echo $row_rslinks['adminname']; ?>">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="inputEmail" class="col-sm-2 control-label" >Email</label>
                      <div class="col-sm-10">
                        <input type="email" class="form-control" name="inputEmail" id="inputEmail" 
                                               value="<?php echo $row_rslinks['email_id']; ?>">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="pwd" class="col-sm-2 control-label">Password</label>
                      <div class="col-sm-10">
                        <input type="password" class="form-control" id="pwd" name="pwd" value="">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="rpwd" class="col-sm-2 control-label">Re-Password</label>
                      <div class="col-sm-10">
                        <input type="password" class="form-control" id="rpwd" name="rpwd" value="">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="num" class="col-sm-2 control-label">Mobile</label>
                      <div class="col-sm-10">
                        <input type="text" class="form-control" id="num" name="num" value="<?php echo $row_rslinks['contactno']; ?>">
                      </div>
                    </div><input type="hidden" name="check" id="check" value="2">

                    <div class="form-group">
                      <div class="col-sm-offset-2 col-sm-10">
                        <button type="submit" class="btn btn-primary">Save</button>
                      </div>
                    </div>

在您的网站上线之前,请确保所有错误只发送到日志文件,而不是浏览器。

什么表单不起作用。您如何知道它不起作用。您是否收到错误消息?请提供更详细的问题,以便我们更好地帮助您。此外,您的代码似乎不完整。例如,您似乎对操作性地混合PHP和HTML代码。例如,您不会在第二个if语句之前打开PHP标记。也不会在
行之前关闭PHP代码。查看PHP日志。它们会告诉您错误所在。这始终是您在处理任何代码时应首先查看的位置。它几乎总是指向您可以找到您的问题所在。其次,查看浏览器中的源代码,看看它是否与您期望的完全一致。如果没有,它会让您很好地了解PHP脚本中的位置。@kojow7,很抱歉没有及时回复,第二个表不工作没有显示错误消息……我的数据库将不会更新。非常感谢您的帮助您的详细解释…将尝试所有这些步骤…如果我仍然遇到问题,将引起您的注意。thx
 <?php if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] ==     "pic_form") &&(($_POST['check'])=== 1)) {
$id=$_POST['monitorimg'];
move_uploaded_file($_FILES['pic']['tmp_name'],"imageupload/".$id);
   $updateSQL = sprintf("UPDATE administrator SET pix=%s WHERE adminid=%s",
                  GetSQLValueString($_POST['monitorimg'], "text"),
                   GetSQLValueString($_POST['ids'], "int"));

    mysqli_select_db($myconn,$database_myconn);
   $Result1 = mysqli_query($myconn,$updateSQL) or    die(mysqli_connect_error());
} 
  ?>      


    <div class="box box-primary">
                    <div class="box-body box-profile">


           <img class="profile-user-img img-responsive img-circle"    width="68" height="68" src="imageupload/<?php echo $row_rslinks['adminid']; ?>".""                     alt="profile picture">
              <form action="<?php echo $editFormAction; ?>" name="pic_form" enctype="multipart/form-data" method="POST">
                   <input type="file" name="pic" class="btn-facebook" required>
                   <input type="submit" class="btn-dropbox" name="sub" id="sub" value="Upload">
                   <input type="hidden" name="ids" id="ids" value="<?php echo $row_rslinks['adminid'];?>">
                   <input type="hidden" name="monitorimg" id="monitorimg" value="<?php echo $row_rslinks['adminid'];?>">
                   <input type="hidden" name="MM_update" value="pic_form">
                  <input type="hidden" name="check" id="check" value="1">
              </form>

                        <h3 class="profile-username text-center"></h3>

                        <p class="text-muted text-center"></p>


  <!-----------This is the second Table code--------------> 


 <?php  if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1") &&(($_POST['check'])=== 1)) {
  $updateSQL = sprintf("UPDATE administrator SET password=%s, adminname=%s, email_id=%s, contactno=%s WHERE adminid=%s",
                   GetSQLValueString($_POST['pwd'], "text"),
                   GetSQLValueString($_POST['inputName'], "text"),
                   GetSQLValueString($_POST['inputEmail'], "text"),
                   GetSQLValueString($_POST['num'], "text"),
                   GetSQLValueString($_POST['stuid'], "int"));

   mysql_select_db($database_myconn, $myconn);
   $Result1 = mysql_query($updateSQL, $myconn) or die(mysql_error());
    }

  ?>
    <div class="tab-content">
                    <div class="active tab-pane" id="settings">
                    <form action=<?php echo $editFormAction; ?>"" name=form11" method=POSTT" enctype="application/x-www-form-urlencoded" class="form-horizontal" id="form1">
                    <div class="form-group" id="stuid">
                      <label for="stuid" class="col-sm-2 control-label">User ID</label>
                      <div class="col-sm-10">
                        <input name="stuid" type="text" class="form-control"  id="stuid"
                                               value="<?php echo $row_rslinks['adminid']; ?>" readonly>
                      </div>
                    </div>
                    <div class="form-group" id="inputeName">
                      <label for="inputName" class="col-sm-2 control-label">Name</label>
                      <div class="col-sm-10">
                        <input type="text" class="form-control" name="inputName" id="inputName"
                                               value="<?php echo $row_rslinks['adminname']; ?>">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="inputEmail" class="col-sm-2 control-label" >Email</label>
                      <div class="col-sm-10">
                        <input type="email" class="form-control" name="inputEmail" id="inputEmail" 
                                               value="<?php echo $row_rslinks['email_id']; ?>">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="pwd" class="col-sm-2 control-label">Password</label>
                      <div class="col-sm-10">
                        <input type="password" class="form-control" id="pwd" name="pwd" value="">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="rpwd" class="col-sm-2 control-label">Re-Password</label>
                      <div class="col-sm-10">
                        <input type="password" class="form-control" id="rpwd" name="rpwd" value="">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="num" class="col-sm-2 control-label">Mobile</label>
                      <div class="col-sm-10">
                        <input type="text" class="form-control" id="num" name="num" value="<?php echo $row_rslinks['contactno']; ?>">
                      </div>
                    </div><input type="hidden" name="check" id="check" value="2">

                    <div class="form-group">
                      <div class="col-sm-offset-2 col-sm-10">
                        <button type="submit" class="btn btn-primary">Save</button>
                      </div>
                    </div>