我有型的两个按钮提交在我view
:如何知道哪个按钮提交表单的PHP
<button type="submit" class="btn btn-default btn-xs" name="Excel">
<span class="glyphicon glyphicon-download-alt"></span> Download as Excel
</button>
<button type="submit" class="btn btn-default btn-xs" name="Resume">
<span class="glyphicon glyphicon-download-alt"></span> Download Resume
</button>
和controller
:
if ($this->input->post('Resume')) {
echo "Resume Clicked";
}
if ($this->input->post('Excel')) {
echo "Excel Clicked";
}
我想知道哪个按钮提交表单为我写了上面的代码..但我没有得到任何echo
点击任何按钮后..
我不想使用在这里:
<input type='submit' name='excel' value='Excel'/>
<input type='submit' name='excel' value='Excel'/>
因为它与类型 '输入' 的作品我想使用的type
submit
你为什么不想用''? –
@BrianWarshaw因为我用于键入按钮的CSS ....以及我得到我的解决方案非常感谢你 –