我还在学习CodeIgniter,如何从值输入中添加<form action="getdata" method="GET">
<input name="id" type="text" value=""/>
<input name="month" type="text" value=""/>
<input name="submit" type="submit" value="Submit"/>
</form>
?
name("id") = 001
name("month") = Feb
实施例
<form action="getdata/001/feb" method="GET">
<input name="id" type="text" value=""/>
<input name="month" type="text" value=""/>
<input name="submit" type="submit" value="Submit"/>
</form>
结果
Calendar calendar = Calendar.getInstance();
答案 0 :(得分:0)
您可以使用CI URI Class
示例:强>
<form action="getdata/001/feb" method="GET">
<input name="id" type="text" value="<?=$this->uri->segment(2)?>"/>
<input name="month" type="text" value="<?=$this->uri->segment(3)?>"/>
<input name="submit" type="submit" value="Submit"/>
</form>
<强>这里:强>
$this->uri->segment(2)
将返回ID(001)和
$this->uri->segment(3)
将返回姓名(二月)
答案 1 :(得分:0)
<?php $ci =& get_instance(); ?>
<form action="getdata/001/feb" method="GET">
<input name="id" type="text" value="<?=$ci->uri->segment(2)?>"/>
<input name="month" type="text" value="<?=$ci->uri->segment(3)?>"/>
<input name="submit" type="submit" value="Submit"/>
</form>
答案 2 :(得分:0)
你是否喜欢
之类的东西if (id == 001 && month == Feb) {
do something;
} else {
do whatever?;
}