我有型的兩個按鈕提交在我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 ....以及我得到我的解決方案非常感謝你 –