[請益] 複選鈕怎麼傳參數

看板PHP作者 (知足常樂)時間17年前 (2008/05/09 10:41), 編輯推噓1(106)
留言7則, 4人參與, 最新討論串1/5 (看更多)
請問一下  複選鈕該如何傳參數 test1.php <form method="POST" action="test1.php"> <input name=\"gene_name[]\" type=\"checkbox\" value=\"$allname[0]\" checked=\"checked\"/><font face=\"Times New Roman\" size=\"4\"> $allname[0]</a></font>"; <input name=\"gene_name[]\" type=\"checkbox\" value=\"$allname[1]\"/> <font face=\"Times New Roman\" size=\"4\">$allname[1]</a></font>"; ............. <embed src="svg.php?start_location=<?=$start_location;?>&end_location= <?=$end_location;?>&name=<?=$gene_name;?>" width="1300" height="1400" type='image/svg+xml' pluginspage='http://www.adobe.com/svg/viewer/install/' /> svg.php $select_name=$_GET['name']; 但是$select_name印出來是Array 若用$select_name=$_POST['name'];  印出來沒有東西 請問一下有沒有什麼方式可以傳複選選單的參數呢? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.121.219.142

05/09 10:53, , 1F
你 print_r($_POST['gene_name']) 看看
05/09 10:53, 1F

05/09 13:22, , 2F
我在svg.php裡
05/09 13:22, 2F

05/09 13:23, , 3F
$select_name = print_r($_POST['gene_name']);
05/09 13:23, 3F

05/09 13:23, , 4F
但只看到 第0個元素
05/09 13:23, 4F

05/09 13:25, , 5F
把 $select_name 印出來只看到第0個元素
05/09 13:25, 5F

05/09 15:36, , 6F
$s = $_POST['gene_name'];$s[0];$s[1]...$s[n];
05/09 15:36, 6F

05/14 14:56, , 7F
推樓上
05/14 14:56, 7F
文章代碼(AID): #188xdFGr (PHP)
文章代碼(AID): #188xdFGr (PHP)