php怎么接收由smarty写的复选框(html_checkboxes)提交的值 30
<?php//include("D:\WWW\Web\\test\\001\smarty\configs\config.php");include("test_conn_...
<?php
//include ("D:\WWW\Web\\test\\001\smarty\configs\config.php");
include("test_conn_tpl.php");
$smarty->assign("id",array(1001,1002,1003,1004,1005,1006,1007,1008));
//$smarty->assign("id",1002);
$smarty->assign("xingge",array("积极乐观","老成持重","光明磊落","风趣幽默","沉默内向","严肃认真","善解人意","乐善好施"));
//$smarty->assign("xingge","光明磊落");
$smarty->assign("xingge_id",1001);
$smarty->display("test013.tpl");
?>
<form action="test_if2222.php" method="post">
{% html_checkboxes name="abc" values=$id checked = $xingge_id output = $xingge separator ="<br>" %}
<input type="text" name="user_name">
<input type="submit" value="提交">
</form>
请问test_if2222.php页面该怎么写 展开
//include ("D:\WWW\Web\\test\\001\smarty\configs\config.php");
include("test_conn_tpl.php");
$smarty->assign("id",array(1001,1002,1003,1004,1005,1006,1007,1008));
//$smarty->assign("id",1002);
$smarty->assign("xingge",array("积极乐观","老成持重","光明磊落","风趣幽默","沉默内向","严肃认真","善解人意","乐善好施"));
//$smarty->assign("xingge","光明磊落");
$smarty->assign("xingge_id",1001);
$smarty->display("test013.tpl");
?>
<form action="test_if2222.php" method="post">
{% html_checkboxes name="abc" values=$id checked = $xingge_id output = $xingge separator ="<br>" %}
<input type="text" name="user_name">
<input type="submit" value="提交">
</form>
请问test_if2222.php页面该怎么写 展开
3个回答
展开全部
把复选框中的name值写成一个数组,例:aa[] ,这样在提交的文件中直接$_POST[aa],就可以获取到复选框所选中的值啦
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
<input type="submit" value="提交">要加个name属性"submit"
if(isset($_POST['submit'])){
$checkval =$_POST['abc'];
$username = $_POST['user_name'];
echo $checkval.username;
}
if(isset($_POST['submit'])){
$checkval =$_POST['abc'];
$username = $_POST['user_name'];
echo $checkval.username;
}
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
if($_POST){
$checkval =$_POST['abc'];
$username = $_POST['user_name'];
echo $checkval.username;
}
这样就对了
$checkval =$_POST['abc'];
$username = $_POST['user_name'];
echo $checkval.username;
}
这样就对了
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询