作者ntouckcm (知足常乐)
看板PHP
标题Re: [请益] 复选钮怎麽传参数
时间Fri May 9 13:39:35 2008
※ 引述《ntouckcm (知足常乐)》之铭言:
: 请问一下
: 复选钮该如何传参数
: 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']; 印出来没有东西
: 请问一下有没有什麽方式可以传复选选单的参数呢?
我在svg.php
改为
$select_name = print_r($_POST['gene_name']);
$select_name的值一直是1
即使只有一个元素是3
$gene_name[0]=3
请问有没有人 知道该如何用呢?
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.121.219.142
1F:→ starjou:有勾的才会传回 SERVER 05/09 13:45
2F:推 JoeHorn:建议去看看 print_r() 的用法,不是你这样用的.... =_= 05/09 14:45
3F:→ ntouckcm:$select_name = print_r($_POST['gene_name'],true); 05/09 14:52
4F:→ ntouckcm:我少设定一个参数,这样才是把结果回传 05/09 14:53