php$\u GET在提交表单后会丢失值,因此我无法使用它更新数据库表

php$\u GET在提交表单后会丢失值,因此我无法使用它更新数据库表,php,html,mysql,forms,get,Php,Html,Mysql,Forms,Get,这是我试图更新数据库页面的页面 除了在最初提交表单后丢失$\u get中的值但丢失的部分之外,所有内容都是正确的 $active_id=$_GET['client_id']; $query = "UPDATE clients SET name='$updatedName1',surname = '$updatedSurname', tel1='$updatedTel1', tel2='$updatedTel2', id_num='$updatedTel2',

这是我试图更新数据库页面的页面

除了在最初提交表单后丢失$\u get中的值但丢失的部分之外,所有内容都是正确的

$active_id=$_GET['client_id'];



 $query = "UPDATE clients SET name='$updatedName1',surname = '$updatedSurname', tel1='$updatedTel1', tel2='$updatedTel2', id_num='$updatedTel2', 
                                         address='$updatedAddress1' WHERE client_id = '$active_id' ";
这是我从中获取值的页面

 if ( $name != ''){
                  echo "<tr>", "<td>", "<a  href=\"display_row.php?client_id=$id\">",$id_num, "   " ,$name ,"    ",$surname,"</a>","</td>","</tr>";

echo "<form method ='POST' name = 'update' action='display_row.php'>";
            echo "</br>";
            echo "</br>";
            echo  "<th style='color:green' >name</th><th style='color:green'>surname</th>"; 
            echo  "<tr >","<td>","<input type ='text'  name ='surname' value ='$Fname'>","<td>","<input type ='text' name ='name' value ='$Fsurname'>","</td>","</tr>";
            echo "</table>";
            echo  "</br>";
            echo  "</br>";
            echo "<table>";
            echo  "<th style='color:green' >Telephone1</th><th style='color:green'>Telephone2</th>"; 
            echo  "<tr >","<td>","<input type ='text'  name ='tel1' value ='$Ftel1'  >","<td>","<input type ='text' name ='tel2' value ='$Ftel2'>","</td>","</tr>";
            echo "<table>";
            echo "<tr>","<td>","<label style='color:green'>Id No: ","</td>","</tr>", "<tr>","<td>","<input type ='text' name ='id_num' value ='$Fid_num' >","</td>","</tr>","</br>","</br>";
            echo "<tr>","<td>","<label style='color:green'>Address: " ,"</td>","</tr>", "<tr>","<td>", "<input type ='text' name ='address' value ='$Faddress' >","</td>","</tr>","</br>","</br>";
            echo "</table>","</br>","</br>";
            echo "<input type ='submit'  style='color:green;width:120;height:60;border-radius: 25px;' name= 'go' value ='Update'>";
            echo "</br>";
            echo "</br>";
            echo "</br>";
           echo "</form>";
if($name!=''){
回声“,”,“,”,”;
回声“;
回声“
”; 回声“
”; 回显“nameurname”; 回音“,”,“,”,“,”,“,”,”; 回声“; 回声“
”; 回声“
”; 回声“; 回显“电话1电话2”; 回音“,”,“,”,“,”,“,”,”; 回声“; 回显“,”Id号“,”,“,”,“,”,“,”,“,”,“,”,“
,“
”; 回音“,”地址“; 回声“,”
”,“
”; 回声“; 回声“
”; 回声“
”; 回声“
”; 回声“;
有两种可能的解决方案:

  • 将您的
    GET
    值插入
    action

     <form action='<your_action>&client_id=<?=$_GET["client_id"]?>'>
    

  • 有两种可能的解决方案:

  • 将您的
    GET
    值插入
    action

     <form action='<your_action>&client_id=<?=$_GET["client_id"]?>'>
    

  • 有两种可能的解决方案:

  • 将您的
    GET
    值插入
    action

     <form action='<your_action>&client_id=<?=$_GET["client_id"]?>'>
    

  • 有两种可能的解决方案:

  • 将您的
    GET
    值插入
    action

     <form action='<your_action>&client_id=<?=$_GET["client_id"]?>'>
    


  • 提交此内容的表单/url调用在哪里?你能将其添加到帖子中吗?@Norbert van Nobelen你是指我的帖子按钮后面的代码还是完整的表单,你可以用url或表单进行测试。因此表单或url是最小值。如果你使用表单:请发布表单。@NorbertvanNobelen url在他的帖子中y:
    display_row.php?client_id=$id
    @anchor我理解。Genhis的答案应该可以解决您的问题。当您发布表单时,url会变成表单操作中的任何内容,当您选中$\u GET时,它就不在了,因为它不再在服务器处理的最后一个url中。提交此内容的表单/url调用在哪里?您可以吗将其添加到帖子中?@Norbert van Nobelen你是指我的帖子按钮后面的代码还是完整的表单,你可以只使用URL或表单进行测试。因此表单或URL是最小的。如果你使用表单:请发布表单。@Norbert vannobelen URL已经在他的帖子中:
    display_row.php?client_id=$id
    @anchor我明白。Genhis的答案应该可以解决你的问题。当你发布表单时,url会变成表单操作中的任何内容,当你去检查$\u GET时,它就不在了,因为它不再在服务器处理的最后一个url中。提交此内容的表单/url调用在哪里?你能将其添加到帖子中吗?@Norbert van Nobelen你在哪里在我的post按钮后面传递代码或使用get的完整表单,您可以只使用URL或表单进行测试。因此,表单或URL是最小值。如果您使用表单:请发布表单。@NorbertvanNobelen URL已经在他的帖子中:
    display_row.php?客户端id=$id
    @anchor我理解。Genhis的答案应该可以解决您的问题lem.当你发布表单时,url会变成表单操作中的任何内容,当你去检查$\u GET时,它就不在了,因为它不再在服务器处理的最后一个url中。提交此内容的表单/url调用在哪里?你能将其添加到帖子中吗?@Norbert van Nobelen你是指我的发布按钮后面的代码还是复杂的使用get的te form你可以只使用URL或表单进行测试。因此表单或URL是最小值。如果你使用表单:请发布表单。@NorbertvanNobelen URL已经在他的帖子中:
    display_row.php?client_id=$id
    @anchor我理解。Genhis的答案应该可以解决你的问题。当你发布表单时,URL会变成任何东西在你的表单操作中,当你去检查$\u GET时,它不再存在,因为它不再在服务器处理的最后一个url中。`@Genhis我得到了你的宝贵建议。`这就是你,谢谢`@Genhis我得到了你的宝贵建议。`这就是你,谢谢`@Genhis我得到了你的宝贵建议。`这就是你,谢谢`@Genhis我收到了你的宝贵建议……这就是你想要的吗,谢谢