如何实现多级添加 我在添加数据的时候有两级,例如!我在添加题目的时候,在添加题目的选项题目可以添加多个,每个题目也有多个选项,在php中如何来做呢?? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 这还是用js控制吧,PHP太麻烦了。http://zhidao.baidu.com/question/28465358.html 还是不太清楚你的需求,从前台提交的数据,不论是post or get,后台获取肯定是根据name or id来获取数据 你给他们起不同的name值不就行了。选项是什么? 复选框 or 单选框? 题目1:<input type="text" name="opt1[]" ><input type="text" name="opt1[]" ><input type="text" name="opt1[]" >题目2<input type="text" name="opt2[]" ><input type="text" name="opt2[]" ><input type="text" name="opt2[]" >php接收:$_POST['opt1']/$_POST['opt2'] //两者皆为数组 <form action="postTest.php" method="post"> <table width="80%" cellspacing="1" cellpadding="0" bgcolor="#E0E0E0" bordercolor="#ccc"> <tr> <td colspan="2"><input name="timu" type="text" value="大板块"></td> </tr> <tr> <td><input type="text" name="xuanxiang" style="margin-left:30px;" value="小版块"></td> </tr> <tr> <td><input type="text" name="xuanxiang" style="margin-left:30px;" value="小版块"></td> </tr> <tr> <td><input type="text" name="xuanxiang" style="margin-left:30px;" value="小版块"></td> </tr> <tr> <td><input type="text" name="xuanxiang" style="margin-left:30px;" value="小版块"></td> </tr> <tr> <td colspan="2"><input name="timu" type="text" value="大板块"></td> </tr> <tr> <td><input type="text" name="xuanxiang" style="margin-left:30px;" value="小版块"></td> </tr> <tr> <td><input type="text" name="xuanxiang" style="margin-left:30px;" value="小版块"></td> </tr> <tr> <td><input type="text" name="xuanxiang" style="margin-left:30px;" value="小版块"></td> </tr> <tr> <td><input type="text" name="xuanxiang" style="margin-left:30px;" value="小版块"></td> </tr> </table> <input type="submit"> </form> 所有的 "timu" 改为 "timu[]"所有的 "xuanxiang" 改为 "xuanxiang[]" 两张表进行关联。题目表,选项表。你要的这种二级菜单需要js控制,或者css都可以实现。 注册页面 直接输网址也能验证 问题 请各位推荐一本php做网站的书 Php DOM问题,急用!!!!高手请赐教! 问一个关于用header重定向的问题 php如何读取局域网文件??? 关于php生成验证码 请问如何分析一个大型程序 百思不得其解的问题 session的生命期问题。 如何用php实现asp的Response.Redirect功能? JS获取循环表格中input的值 关于PHP网页用户登陆后显示注销.而登陆前则只显示注册登陆连接的问题
http://zhidao.baidu.com/question/28465358.html
<input type="text" name="opt1[]" >
<input type="text" name="opt1[]" >
<input type="text" name="opt1[]" >题目2
<input type="text" name="opt2[]" >
<input type="text" name="opt2[]" >
<input type="text" name="opt2[]" >php接收:$_POST['opt1']/$_POST['opt2'] //两者皆为数组
<form action="postTest.php" method="post">
<table width="80%" cellspacing="1" cellpadding="0" bgcolor="#E0E0E0" bordercolor="#ccc">
<tr>
<td colspan="2"><input name="timu" type="text" value="大板块"></td>
</tr>
<tr>
<td><input type="text" name="xuanxiang" style="margin-left:30px;" value="小版块"></td>
</tr>
<tr>
<td><input type="text" name="xuanxiang" style="margin-left:30px;" value="小版块"></td>
</tr>
<tr>
<td><input type="text" name="xuanxiang" style="margin-left:30px;" value="小版块"></td>
</tr>
<tr>
<td><input type="text" name="xuanxiang" style="margin-left:30px;" value="小版块"></td>
</tr>
<tr>
<td colspan="2"><input name="timu" type="text" value="大板块"></td>
</tr>
<tr>
<td><input type="text" name="xuanxiang" style="margin-left:30px;" value="小版块"></td>
</tr>
<tr>
<td><input type="text" name="xuanxiang" style="margin-left:30px;" value="小版块"></td>
</tr>
<tr>
<td><input type="text" name="xuanxiang" style="margin-left:30px;" value="小版块"></td>
</tr>
<tr>
<td><input type="text" name="xuanxiang" style="margin-left:30px;" value="小版块"></td>
</tr>
</table>
<input type="submit">
</form>
所有的 "xuanxiang" 改为 "xuanxiang[]"
你要的这种二级菜单需要js控制,或者css都可以实现。