0

首先,我使用下面的代码从包含客户ID的表报价中显示名称、报价ID和用户ID等数据,我想根据表中wid的值更新表报价并更新表中的wpids值引述 。提前感谢那些愿意提供帮助的人

updatequo.php

<?php 
$qid =$_GET["qid"];
$query = mysqli_query ($conn, "SELECT * FROM quotation where qid = '$qid';");
$result = mysqli_fetch_array($query);
?>
<form action='updatequo1.php?qid=<?php echo $qid;?>' method='post'>
<table align='center' width='45%' border='0' cellpadding='0' cellspacing='0'>

<tr>
  <td align='left' width='50%'>Quotation ID<td><input class='Minput'  type ='text' name='qid'value='<?php echo $result["qid"];?>' disabled ></td>
</tr>
<tr>
  <td align='left' width='30%'>User ID<td><input class='Minput'  type ='text' name='uid' value='<?php echo $result["uid"];?>' disabled ></td>
</tr>

但是当我声明 $uid = $_POST['uid']; 在 updatequo1.php 但它说

注意:未定义索引:uid

在 updatequo1.php 我想更新 wpids 的值并根据 wid 值更改它

 $result=mysqli_query ($conn, " UPDATE corders set wpids = '$wid' where customerid = '$uid';");
4

2 回答 2

0

您的输入字段disabled请替换为readonly. 禁用字段数据不能通过 post 或 get 发送。

于 2018-12-09T16:41:48.163 回答
0

索引的原因undefined是因为您有输入disabled

<input class='Minput'  type ='text' name='qid'value='<?php echo $result["qid"];?>' disabled >
<input class='Minput'  type ='text' name='uid' value='<?php echo $result["uid"];?>' disabled >

将其从 更改disabledreadonly

禁用的输入不会根据您的POST请求发送到后端。

于 2018-12-09T16:42:01.207 回答