確定表單按鈕單擊php
if($ _server ['request_method'reaction_method'] ==='post' //提交檢測到表格 if(isset($ _ post ['btndelete'])){ // btndelete單擊 } 別的 { // btnsubmit單擊或默認按鈕 } }
Best PracticesTo ensure proper form button detection, it's essential to:
Assume a default submit button:
Always assume the first submit button appearing in the HTML source code is the default.Only check對於後續按鈕明確:僅測試以後以層次結構形式出現的按鈕。 考慮獲得方法:
為通過get提交的表單,添加隱藏的輸入以指示提交(例如, 1>)。 Then, use isset($_GET['submitted']) to detect form submission.免責聲明: 提供的所有資源部分來自互聯網,如果有侵犯您的版權或其他權益,請說明詳細緣由並提供版權或權益證明然後發到郵箱:[email protected] 我們會在第一時間內為您處理。
Copyright© 2022 湘ICP备2022001581号-3