網站的各位大大們:
我目前在做產品管理的網頁後台。
產品功能中我要做每日一物及熱門商品和價格修改的功能。
每日一物我打算使用input type="radio"來做(產品中只能單選一個)
而熱門商品我想用input type="checkbox"來做。
以下是我從資料庫迴圈出來的資料:
$sql="select * from pds order by id desc";
$rd=mysql_query($sql);
while($row=mysql_fetch_assoc($rd)){
echo "<tr>";
echo "<td>品名:".$row['nam']."</td>";
echo "<td>價格:<input type='text' name='pce' value='".$row['pce']."'/></td>";
echo "<td>每日一物:<input type='radio' name='dayc' value='".$row[dacc]."'></td>"; <---所有的產品中只能單選一個
echo "<td>熱門商品:<input type='checkbox' name='hotc' value='".$row[hotc]."'></td>"; <----可多選產品
echo "</tr>"
}
問題來了,我要如何在這清單上的radio、checkbox直接選和input type="text"輸入就直接post 更新了。
我有查到是要用陣列的方式來去做。
不過我實再不知從何下手,
還請網路上的大大們用簡單的範列指導為我解惑一下。
真得感激不盡。
先謝謝大大們了。
This entry passed through the Full-Text RSS service — if this is your content and you're reading it on someone else's site, please read the FAQ at fivefilters.org/content-only/faq.php#publishers. Five Filters recommends: 'You Say What You Like, Because They Like What You Say' - http://www.medialens.org/index.php/alerts/alert-archive/alerts-2013/731-you-say-what-you-like-because-they-like-what-you-say.html