繁体   English   中英

如何通过URL传递输入,而不是通过锚标记URL传递ID

[英]How to pass input with URL instead of passing ID via anchor tag URL

如果用户喜欢更改记录,则他/她输入数量并单击编辑锚标记以传递带有URL的输入:

****

<form action="saleentry-final.php" method="get" >
<?php 
    for ($i = $start; $i < $end; $i++)  
    {
        if ($i == $total_results)
         {
         break;
         }
    ?>

    <tr>
        <td><input type="checkbox"  name="check_list2[]" value="<?php echo mysql_result($result, $i, 'id');?>"/></td>
        <td><?php echo mysql_result($result, $i, 'item');?></td>
        <td><?php echo mysql_result($result, $i, 'batch_no');?></td>
        <td><?php echo mysql_result($result, $i, 'Mfg_date');?></td>
        <td><?php echo mysql_result($result, $i, 'Exp_date');?></td>
        <td><input name="movie[]" value="<?php echo mysql_result($result, $i, 'qty');?>" class="form-control"></td>
        <td><?php echo mysql_result($result, $i, 'rate');?></td>
        <td><?php echo mysql_result($result, $i, 'vat');?></td>
        <td><?php echo mysql_result($result, $i, 'price');?></td>
        <td><a href="saleentry-edit.php?id=<?php echo mysql_result($result, $i, 'id');?>">EDIT</a></td>
        <td><a href="salesentry-delete.php?id=<?php echo mysql_result($result, $i, 'id');?>">DELETE</a></td>
    </tr>  

    <?php $tot = $tot + mysql_result($result, $i, 'PRICE'); }  ?>
    <tr>
        <td colspan="10">
            <button  type="submit" class="btn btn-primary btn-lg  center-block" name="submit2">Create Invoice</button>
        </td>
    </tr>
    </table>
</form>

我通过锚标记URL传递ID,但是如何传递带有URL的输入?

<a href="saleentry-edit.php?id=<?php echo mysql_result($result, $i, 'id');?>">EDIT</a> 

无论用户使用URL输入什么,我都希望将输入值传递给saleentry-edit.php页面,在saleentry-edit.php页面中获取ID和用户输入值以快速更新数量并动态处理然后重定向到同一页面。

在$ i内部进行循环< input id="state<?php echo $i;?>" name="movie[]" value="<?php $sta = mysql_result($result, $i, 'qty'); echo mysql_result($result, $i, 'qty');?>" class="form-control">

<input type="button" name="inspecionar" id="inspecionar" value="inspecionar" onclick="location.href='/Inventry-System/saleentry-edit.php?id=<?php echo mysql_result($result, $i, 'id');?>&quantity='+ document.getElementById('state<?php echo $i;?>').value;">

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM