close
Blogtrottr
Yahoo!奇摩知識+ - 分類問答 - 電腦網路 - 發問中
Yahoo!奇摩知識+ - 分類問答 - 電腦網路 - 發問中 
Explore DIRECTV

Enjoy HD DVR service in every room. Get every game every Sunday. Watch hit movies and shows anywhere. Bundle and save today!
From our sponsors
php關於checkbox和radio
Aug 8th 2013, 09:37

網站的各位大大們:

我目前在做產品管理的網頁後台。

產品功能中我要做每日一物及熱門商品和價格修改的功能。

每日一物我打算使用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

You are receiving this email because you subscribed to this feed at blogtrottr.com.

If you no longer wish to receive these emails, you can unsubscribe from this feed, or manage all your subscriptions
arrow
arrow
    全站熱搜
    創作者介紹
    創作者 kkotgszvx368m 的頭像
    kkotgszvx368m

    【韓劇推薦】2016年8,韓劇看什麼呢?2016韓劇推薦好看的 , 2016韓劇推薦必看 , 2016韓劇 , 2016韓劇排行榜前十名 , 韓劇推薦 , 2016韓劇介紹 , 2016韓劇排行榜 , 2016韓劇列表 ,

    kkotgszvx368m 發表在 痞客邦 留言(0) 人氣()