我需要检查'option'标签是否设置为$ _POST。
例如,要知道客户端何时按下'select'标签我正在执行此操作:
<?php
if (isset($_POST['select_tag'])) {
echo 'the client pressed on the select tag';
}
?>
<form method="POST">
<select name="select_tag">
<option value="1">1st</option>
<option value="2">2nd</option>
<option value="3">3rd</option>
</select>
</form>
我需要知道客户是否按下值1,2或3,有办法检查吗?
答案 0 :(得分:0)
在$_POST['select_tag']
本身,您将从selectbox
if (isset($_POST['select_tag'])) {
echo 'the client pressed on the select tag '.$_POST['select_tag'];
}
输出:
the client pressed on the select tag 1.