点击按钮后

时间:2018-10-25 09:08:44

标签: php

每次我刷新页面时,我都会生成随机数字。

但是我只想在我点击“生成” 按钮后才生成随机数.....

我可以通过点击php function onclick“生成”按钮来做到这一点。

但是还有什么更简单的方法,点击按钮后表示“回声变量”吗?...

enter image description here

<?php

$r = mt_rand(0000000001,9999999999); 

$result = mysqli_query($con,"SELECT * FROM orders");

echo "<table border='1'>
<tr>
<th>order</th>
<th>payment</th>
<th>generate</th>
<th>track</th>
</tr>";

while($row = mysqli_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['order_id'] . "</td>";
echo "<td>" . $row['payment_type'] . "</td>";
echo "<td><button>" . "Generate" . "</button> </td>";

echo "<td>" . $r . "</td>";

echo "</tr>";
}
echo "</table>";

?>

0 个答案:

没有答案
相关问题