按钮名称未提交,因此
$_POST['submit']未设置php 值。如in
isset($_POST['submit'])评估为false。
<html><form action="" method="post"> <input type="hidden" name="action" value="submit" /> <select name="name"> <option>John</option> <option>Henry</option> <select><!-- make sure all html elements that have an ID are unique and name the buttons submit --> <input id="tea-submit" type="submit" name="submit" value="Tea"> <input id="coffee-submit" type="submit" name="submit" value="Coffee"></form></html><?phpif (isset($_POST['action'])) { echo '<br />The ' . $_POST['submit'] . ' submit button was pressed<br />';}?>
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)