如何在php中獲取提交按鈕的名稱,我得到了提交按鈕的值,但coulnot發現 任何代碼獲取按鈕的名稱,下面是我寫的代碼。獲取PHP中提交按鈕的名稱
<form name="form1" method="post">
<input type="submit" value="hello" name="submitbutton">
</form>
<?php
echo "Value of submit button : " . $_POST['submitbutton'];
echo "Name of submit button : " . //what should i do here//;
?>
是不是提交按鈕是你的名字嗎?比如你如何訪問沒有ID的元素?在你的例子中,你使用它的名字來獲得價值(擊敗我爲什麼)。所以我不知道你想在這裏看到什麼。 –