![](/img/trans.png)
[英]It is secure or possible or not if I used function or class in CodeIgniter to generate table to store my user information?
[英]Is there a way I could store id of my button used in a table?
<?php
while($row = mysqli_fetch_array($results)){
?>
<tbody>
<tr>
<td> <?php echo $row['Product_ID'] ?></td>
<td> <?php echo $row['Product_Name'] ?></td>
<td> <?php echo $row['Product_Price'] ?></td>
<td> <?php echo $row['Product_Stock'] ?></td>
<td> <button type="submit" name="add" id="<?php $row['Product_ID'] ?>" onclick="func(<?php $row['Product_ID'] ?>)"> Add </button></td>
</tr>
<?php } ?>`
<script type="text/javascript" method="post">
function func(id){
window.alert(id);
};
</script>
有沒有一種方法可以存儲名為add的按鈕的ID? 我必須存儲多個產品ID,並在使用產品ID生成的收據中使用它們。 表單的方法是POST
但我不知道如何獲取ID
取代這個
func(<?php $row['Product_ID'] ?>)
有了這個
func(<?php echo $row['Product_ID']; ?>)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.